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 are the differences between c++ and java?

0 Answers  


What is mean by collections in java?

0 Answers  


What is meant by data hiding in java?

0 Answers   Aspire, Infogain,


Can you start a thread twice in Java?

0 Answers  


what is the difference b/w static and final methods?

1 Answers  






Can we override private constructor in java?

0 Answers  


What is anagram word?

0 Answers  


What is threaded programming and when is it used? : Java thread

0 Answers  


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

0 Answers  


Why are lists ordered in java?

0 Answers  


Can a class be final?

0 Answers  


Can a method inside a interface be declared as final?

0 Answers  


Categories