Infinite loop using while ?

Answers were Sorted based on User's Feedback



Infinite loop using while ?..

Answer / nav dev

boolean a=true;
while(a)
{
//here a should be boolean type
System.out.println(a);
}

Is This Answer Correct ?    4 Yes 0 No

Infinite loop using while ?..

Answer / sanjay singh bisht

while(true)
{
System.out.println("sanju baba");
}

Is This Answer Correct ?    2 Yes 0 No

Infinite loop using while ?..

Answer / nitin

int a=5;
while(a)
{
System.out.println(a);
}

or

while(true)
{
System.out.println("true");
}

Is This Answer Correct ?    1 Yes 0 No

Infinite loop using while ?..

Answer / sukale shobha balshiram

int a=0;
while(a+1)
{
System.out.println(a);
}

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More Core Java Interview Questions

What is a condition in java?

1 Answers  


What is hasnext in java?

1 Answers  


What is the main advantage of passing argument by reference?

1 Answers  


What does java se mean?

1 Answers  


Why is it called a string?

1 Answers  


Is string an object?

1 Answers  


What is the purpose of checked and unchecked exceptions in JAVA?

1 Answers   Amdocs,


Can we sort set in java?

1 Answers  


What is the difference between interface & abstract class?

1 Answers  


What are the advantages of functions?

1 Answers  


What is a class ?

8 Answers  


What is java console application?

1 Answers  


Categories