Home Answers Viewqa Java-Beginners while and do while

 
 


samar
while and do while
1 Answer(s)      2 years and 7 months ago
Posted in : Java Beginners

hello,

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

View Answers

October 25, 2010 at 11:25 AM


hello,

 A while statement checks at the beginning of a loop to see whether the next loop

iteration should occur. A do statement checks at the end of a loop to see whether the next iteration

of a loop should occur. The do statement will always execute the body of a loop at least once.









Related Pages:
while and do while
while and do while  hello, What is the difference between a while statement and a do statement?   hello, A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do
The while and do
While and do-while      ...-while statement now. Here is the syntax: do { statement(s) } while (expression); Lets tweak an example of do-while loop
While and do-while
While and do-while       Nested classes Here is another advantage of the Java, object-oriented programming language that allows us to define a class within another
while & do..while Loop
while & do..while Loop while loop The while loop iterate until provided... : Value of j 1Value of j 2Value of j 3 The do...while statement The do-while... : do   {   code to be executed;   } while (condition
php do while syntax
php do while syntax  How to create a do while loop in php. What is the syntax
php do while example
php do while example  Simple example of do while loop in PHP
php do while loop
php do while loop  Difference between do while loop and simple loop in PHP
php do while break
php do while break   receiving a Fatal saying cannot break/continue.. please suggest. Thank U
php do while false
php do while false   Is there any difference between FALSE and false
do-while loop
do-while loop  how many times will the following loop get executed and what will be the final value of the variable I after execution the loop is over. int I = 5; do{ I + = 3; System.out.println(""+I); I=I+1; }while(I>=9
programes on do... while
programes on do... while   write a program to print reverse of a given digit write a program to check whether entered digit is palindrome... = num; //use to check at last time int check=0,remainder; while(num > 0
While and do-while
While and do-while      ... at do-while statement now. Here is the syntax: do { statement(s) } while (expression); Lets tweak an example of do-while loop
Class.forName will do while loading drivers
Class.forName will do while loading drivers  What Class.forName will do while loading drivers
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...(); while (Ite.hasNext...(); while (Ite.hasNext
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...(); while (Ite.hasNext...(); while (Ite.hasNext
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...(); while (Ite.hasNext...(); while (Ite.hasNext
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...(); while (Ite.hasNext...(); while (Ite.hasNext
do-while Loop in Java
do-while Loop in Java      ... and processes once at least. For that you have to use the do while loop in  after that check the condition then we use the do-while loop statement. do-while loop
do while loop
do while loop       In java a do while loop is a control flow statement that allows a certain code... with a condition associated with the while keyword. The code inside the do construct
PHP Do While Loop
Do-While Control Structure: Do-While loop is another type of loop which runs... within. We generally use Do-While loop  when the iteration must run at least once despite of the validity of the variable. In Do-While loop we need
Do..While Loops
3.10.2. Do…While Loops The do...while statement always execute... the condition is true. Syntax do { code to be executed; } while (condition); e.g.... reaches to either 5 or less than 5. <?php $i=1; do { $i++; echo &ldquo
PHP Do While Loop
Do-While Loop Function PHP: PHP Do-While loop method is another type of loop... the code within. We generally use Do-While loop  when the iteration must run at least once despite of the validity of the variable. In Do-While loop we need
reached end of file while parsing and while expected
reached end of file while parsing and while expected  import java.io....); do { if(input2=='c'||input2=='C') { degreesC=5*(temp-32)/9...; System.out.println("Fahrenheit:"+degreesF); System.out.println("Do you want to try
Java Break while example
be used for terminating other loops as well such as while, do while etc. . Break... Java Break while example     ... the while loop is demonstrated.  In the program we breaking while loop under
Use if, if else,for,while,do wile ad switch in same Java Class
Use if, if else,for,while,do wile ad switch in same Java Class  hi how to use if, if else,for,while,do wile ad switch in same class? very urgent... "); System.out.println("5. Exit"); boolean quit = false; do{ System.out.print("Please
How to write a loop and a while loop
How to write a loop and a while loop  How do I write a 1 loop and a 1 while loop for the example code: public boolean isTheFirstOneBigger (int num1, int num2) { if (num1 > num2) { return true
Iterator Java While
The Java While loop Iterator is the top tested loop. It is in two forms while(), do while() While loop is mostly used with Iterator compared to for loop... .. while"); do { System.out.print(it1.next() + "\t"); } while
Java while coding - Java Beginners
Java while coding  Java loop and function coding question? How can I... * 19; I'd to use a method (function) to do the computation I'd like... boolexit=true; do { BufferedReader br = new BufferedReader(new
PHP While Loop
are used namely for, while and do while. Apart from these there are some loops... tutorial we will study while, do while and for. So let's get started: While...While Loop in PHP: In programming language we need to use loops for executing
Erron while
Erron while   Hi, i'm doing a project regarding xml. I want to extract all nodes from body of existing xml doc to make another xml with that data.Here is my coding and error showing on that coding.Could anybody help to know my
Terms to be avoided while writing for the Web
Terms to be avoided while writing for the Web  ... that the web can provide you with but do not become self referential. &lsquo... then they are words to be avoided. If you are confused then the best thing to do
Show spinner while loading image using JavaScript
of seconds before the chart changes. What i want do is it shows spinner while loading...Show spinner while loading image using JavaScript  Hello sir I am... do this by using the power of setTimeout() method. This allows you set a timer
Java error reached end of file while parsing
of file while parsing  occurred when a programmer do not close the class ... Java error reached end of file while parsing... of file while parsing ,In this code we want to display Time in hour, minute
Using while loop to loop through a cursor
= 1; OPEN cur1; cur1_loop:WHILE(done=0) DO FETCH cur1... Using while loop to loop through a cursor  ... while loop to loop through a cursor'. The Example create a table Stu_Table
how to make enable/disable textbox in while(rs.next)
how to make enable/disable textbox in while(rs.next)  Hi, I'm trying to enable/disable the textbox in the while loop. It works but when i want.../disable function,the data are updated correctly. Is my javascript wrong? How do i
how to make enable/disable textbox in while(rs.next)
how to make enable/disable textbox in while(rs.next)  Hi, I'm trying to enable/disable the textbox in the while loop. It works but when i want.../disable function,the data are updated correctly. Is my javascript wrong? How do i
How do I change the while loop in this code to the range with range list style display page for a resultSet() in jsp?
How do I change the while loop in this code to the range with range list style display page for a resultSet() in jsp?  this is count record code...); while (rs.next()) { rows =rs.getInt(1); %> <
The While keyword
The While keyword       While is a keyword defined in the java programming language. Keywords... programming language likewise the while keyword indicates the following
php while loop
php while loop  Example to fetch the data using while loop in PHP
While loop Statement.
While loop Statement.   How to Print Table In java using While Loop
Use while loop in jsp code
between while and do while loop, do while loop first execute the loop body... Use while loop in jsp code       While loop is a control flow statement that works
php array loop while
php array loop while  Using the php array while loop
while loop to for loops
while loop to for loops  I have to change this while loops... to know how to change it. int currentNum= num1; while(num1>num2... Are: "); while(num1 <= num2) { if(num1%2 != 0) { System.out.print
while executing a java program
while executing a java program  while iam executing a simple java program after i type "java simple.java" there was a an error occuring.the error is "exception in thread "main" java.lang.noclassdeffounderror:simple" what thus
Memory leak in While loop
Memory leak in While loop  How to manage a memory leak in While loop ?   make sure loop is not running infinitley. ------------------------------------ Chandraprakash Sarathe http://javaved.blogspot.com/   
While loop Statement
While loop Statement  How to print a table using while loop?   The given example displays the multiplication table of the given number... +" = "); while(y<=10) { int t = x
programes on while loop
programes on while loop   write a program to calculate sum of an entered digit write a program to find gcd and lcm of 2 positive integers   Java sum of digits Java Find LCM and GCD
While loop - Java Beginners
While loop  Given a number, write a program using while loop to reverse the digits of the number. Eg. the no. is 12345, should be written as 54321...(br.readLine()); int n=num; int rem=0; int rev=0; while(n!=0
While running jsp
While running jsp  I found this error when i run the client.jsp can anyone help me javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8080/WebService1/MyWebService?wsdl. It failed with: http
while loop handling
while loop handling  Dear deepak, thanks for your response yesterday.. I am doing a project on travelling domain.. in that initially i searched all... option the while loop always taking tyhe last flight datails only... and in all

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.