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
How does map works in java?
Why local variables are stored in stack?
What purpose do the keywords final, finally, and finalize fulfill?
Can we override private method in java?
What is the use of singleton?
What are namespaces in java?
What is supplier in java?
What is the access scope of protected access specifier?
Which category the java thread do fall in?
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea
What are assembly attributes?
Is a char always 1 byte?
Is break statement can be used as labels in java?
What is anagram of a string?
What are the four pillars of java?