What is the difference between a while statement and a do statement?



What is the difference between a while statement and a do statement?..

Answer / Amit Pant

The main difference between a while loop and a do-while loop in Java is that a while loop checks the condition at the beginning of each iteration, whereas a do-while loop checks the condition at the end. A do-while loop will always execute at least once before checking the condition.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Java Related AllOther Interview Questions

What is jboss in java?

1 Answers  


Do I need both jdk and jre?

1 Answers  


What are jpa annotations?

1 Answers  


How can c# app request minimum permissions? : java security

1 Answers  


What is dialect in java?

1 Answers  


What is the purpose of jdk?

1 Answers  


What is a java proxy?

1 Answers  


Is jpa a framework?

1 Answers  


Which is best framework in java?

1 Answers  


What kind of thread is the garbage collector thread?

1 Answers  


what is the package for freshers in valuelabs.

1 Answers  


What is jdk jre and jvm?

1 Answers  


Categories