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


Please Help Members By Posting Answers For Below Questions

What is lazy initialization in java?

556


What is the difference between a break statement and a continue statement?

598


Can a class be defined inside an interface?

565


Can a class be private in java?

545


What are wrapper classes in java?

600






what is use of functional interface in java 8?

561


What is unicode datatype?

531


Can we assign the reference to this variable?

545


What are heterogeneous objects?

568


what methods would you overwrite in java.lang.object class?

566


Describe method overriding

589


How can an exception be thrown manually by a programmer?

513


What do you understand by java virtual machine?

709


What is data type in computer?

521


Convert a BST into a DLL and DLL to BST in place.

674