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.

*/

}

Answers were Sorted based on User's Feedback



for(i=0;i<100;i++) { int i=method();//method returns no's from 1 to 10; /* insert so..

Answer / 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

for(i=0;i<100;i++) { int i=method();//method returns no's from 1 to 10; /* insert so..

Answer / 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

for(i=0;i<100;i++) { int i=method();//method returns no's from 1 to 10; /* insert so..

Answer / $ourav

static int []arr=new int[10];
arr[i]++;

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Core Java Interview Questions

How does the java compiler work?

0 Answers  


What is the difference between comparison done by equals method and == operator?

0 Answers  


What is an object in java and how is it created?

0 Answers  


Can you give few examples of final classes defined in java api?

0 Answers  


Mention some features of java?

0 Answers  






What is mnemonic code?

0 Answers  


How can you write a loop indefinitely in java programming?

0 Answers  


Which is better list or arraylist in java?

0 Answers  


What are the 3 types of control structures?

0 Answers  


Difference between abstract class and Interfaces?

7 Answers   CTS, iFlex, PA Consulting, Sai Softech, Value Chain,


What is the intersection and union methods?

0 Answers  


What is Recursion Function?

0 Answers   iNautix,


Categories