Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 do you compare objects in java?

0 Answers  


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

0 Answers   Amazon,


What is the difference between interpreter and compiling ?

7 Answers   TCS,


Why you should not use singleton?

0 Answers  


Can a class extend more than one class?

0 Answers  


Which is bigger double or float?

0 Answers  


Why is whitespace important?

0 Answers  


How the threads are synchronized?

2 Answers   BMC, CTS,


what is the difference between equals method and ==

17 Answers   IBM, Professional Access, TCS,


What is the difference between a synchronized method and a synchronized block?

0 Answers  


Why do we need hashset in java?

0 Answers  


Where are local variables stored?

0 Answers  


Categories