for(i=0;i<100;i++)
{
int i=method();//method returns no's from 1 to 10;
/*
insert some stmts which can give output like no.of times
numbers(1-10) returned. (for example if it returns 2 then i
want output how many times 2 returned) like that i want
output for no's 1 - 10 how many times each no returned.
*/
}
Answer Posted / abhishek.cusat.it2007
class X
{
public void method()
{
int x=0;
do{
x++;
System.out.println(x);
}
while(x<10);
{
System.out.println("this is your Ptogaram");
}
}
public static void main(String[] as)
{
X a=new X();
for(int i=0;i<100;i++)
{
a.method();
break;
}
}
}
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is lazy initialization in java?
What is the difference between a break statement and a continue statement?
Can a class be defined inside an interface?
Can a class be private in java?
What are wrapper classes in java?
what is use of functional interface in java 8?
What is unicode datatype?
Can we assign the reference to this variable?
What are heterogeneous objects?
what methods would you overwrite in java.lang.object class?
Describe method overriding
How can an exception be thrown manually by a programmer?
What do you understand by java virtual machine?
What is data type in computer?
Convert a BST into a DLL and DLL to BST in place.