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 are parsing rules?
Is namespace same as package in java?
What is arguments in java?
Can a class extend 2 classes in java?
What is math exp in java?
Can a class declared as private be accessed outside it’s package?
What is the purpose of extern variable?
How does a for loop work java?
What is a string what operation can be performed out with the help of a string?
Which command from the jdk compiles a java program?
What is serial version uid and its importance in java?
What is a parameter in java?
What is the purpose of the system class in java?
Explain about serializable interface in java?
What is difference between static variable and global variable?