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 kumar

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 ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a nonetype?

565


What is the use of keywords in java?

555


Is a class subclass of itself?

604


Is array synchronized in java?

553


What is the access scope of a protected method?

562






What is the main function in java?

529


Can a class be private?

516


what is the constructor and how many types of constructors are used in java?

537


Why we use multi threading instead of multiprocessing?

576


How many threads can java run?

559


Can you extend singleton class?

602


How to instantiate member inner class?

626


Can we override protected method in java?

580


Explain features of interfaces in java?

560


Can we use string in the switch case?

577