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
What are the types of methodology?
Is a string literal?
Can we inherit a class with private constructor?
What are the differences between wait() and sleep()?
Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?
How hashmap works in java?
Can we override the private methods?
Write a code to create a trigger to call a stored procedure
What are constants and how to create constants in java?
What are the wrapped, classes?
Is singleton a bad practice?
Describe what a thread-local variable is in java?
When should I use singleton?
What is null statement?
What are the five major types of reference sources?