answersLogoWhite

0

Difference between while and do while loops in java?

Updated: 8/16/2019
User Avatar

Wiki User

13y ago

Best Answer

The most important differences are:

a. The while loop starts with a condition whereas the condition is the line of code in case of a do while loop

b. The do while loop is guaranteed to run the loop body atleast once even if the condition is an impossible to satisfy but such a guarantee is not available with the normal while loop

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between while and do while loops in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which java loops are entry controlled?

The for and while statements are entry-controlled loops. The do-while statement is an exit-controlled loop.


Why do you use the loops in java?

You use loops in Java when you want a set of actions to be repeated until a particular condition is met or for a certain number of times.The different types of loops in Java are:For LoopsDo-While LoopsWhile Loops


Tell 2 or 3 differences in table manner of differences between for and while loops?

Both For and While loops are available for the purpose of executing a piece of java code repeatedly until a particular condition is met. The only difference being - the loop condition/counter has to be modified inside the while loop every time whereas the condition is integrated in the for loop definition. Otherwise both the loops are exactly same in all aspects.


What is an important difference between writing a Java application and a Java applet?

A Java applet is embedded within a web page, while a Java application will run directly on your computer.


What are the different between'a' and ''a in java string methods?

The difference between 'a' and "a" anywhere in Java is that 'a' is a primitive char type, while "a" is a String object.


What is difference between java 2 and java 5?

They are different versions. Java 5 is newer than Java 2. Think of it like the difference between the Playstation 1 and the Playstation 3.


Difference between equals equals and equal in java?

"==" in java is the binary operator which compares two values and gives a boolean result While "=" in java is a assignment operator which assigns a value to a variable.


What looping structures are there in JavaScript?

Loops in Java Script are:for - loops through a block of code a specified number of timeswhile - loops through a block of code while a specified condition is truedo...while - also loops through a block of code while a specified condition is truefor...in - loops through the properties of an objectFor more information, visit the Related Link.


Major difference between c and java?

Java is object oriented, C is not...


What is the difference between connectivity in java?

kamina


What is difference between connectivity in java?

kamina


What is the main difference between UNIX and JAVA?

Unix is an operating system, Java is a language.