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 charat ()?

0 Answers  


Explain the difference between jdk, jre, and jvm?

0 Answers  


Name few java util classes introduced with java 8 ?

0 Answers  


Why a dead thread occurs?

0 Answers  


What are the 2 types of java programs?

0 Answers  






What exactly is java?

0 Answers  


Why java is object oriented?

0 Answers  


What is assembly used for?

0 Answers  


Why Java is called as purely platform independent..? Explain briefly..dont Give regular answers Explain with your own example..?

8 Answers   Nokia,


what are the states associated in the thread? : Java thread

0 Answers  


What is a line break?

0 Answers  


what is the use of clone method? why user cant overwrite in sub class without its proper defination.

2 Answers   TCS,


Categories