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 difference between add() and addelement() in vector?
Explain about method local inner classes or local inner classes in java?
Difference between overriding and overloading in java?
How do you compare arrays in java?
What does nextint () do in java?
What is a variable declaration?
Are strings immutable in java?
Describe the term diamond problem.
When throw keyword is used?
What are multiple inheritances?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
What is a class in java?
What is the final method?
Can a function return a function?
Explain constructors and types of constructors in java.