Java Tutorial: While Loop and do-while loop in Java | Difference between while loop & do while loop

Published: 25 January 2022
on channel: Parnika Tutorials
304
9

"Java Tutorial: While Loop and do-while loop in Java | Difference between while loop and do while loop | Java Tutorial for beginners

#whileloop #dowhileloop #javaloop #javawhileloop #javadowhileloop #featuresjava #java #javafullcourse #javatutorials #javaforbeginners #javalanguage #learnjava #javacompletecourse #javaprogramming #javatutorialforbeginners #parnikatutorials #javacourse
previous video -    • Java Tutorial: The for Loop in Java | Loop...  
#12 FOR LOOP IN JAVA | INTRODUCTION TO LOOPS | JAVA COURSE FOR BEGINNERS
00:00 - Introduction
00:36 - While loop
07:29 - Java program to compute factorial of a number
17:21 - Implementation of java program
22:48 - Do while loop
29:34 - Java program on do while loop
33:45 - Implementation of java program"

Social media Links:
Instagram:   / parnikatutorials  
Website:
Email id: [email protected]
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id...
Linkedin:   / parnika-tutorials-a8a9831b2  
Pinterest:   / parnikatutorials0892  

Playlists:
Virtual Coffee with Jagadeesh:    • VIRTUAL COFFEE WITH JAGADEESH  
Digital Logic:    • ABOUT PARNIKA TUTORIALS  
Computer Organization and Architecture:    • ABOUT PARNIKA TUTORIALS  
C Programming:    • L 1: WHAT IS AN ALGORITHM AND CHARACTERIST...  
Data Structures:    • L 1: Uncover the Benefits of Linked List: ...  
Theory of Computation:    • ABOUT PARNIKA TUTORIALS  
Compiler Design:    • ABOUT PARNIKA TUTORIALS  
Operating Systems:    • PROCESS STATE DIAGRAM | LONG TERM, SHORT T...  
Databases:    • ABOUT PARNIKA TUTORIALS  
Computer Networks:    • ABOUT PARNIKA TUTORIALS  
For GATE PYQs and much more explore:    / parnikatutorials  

Java while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating if statement.
Syntax:

while (test_expression)
{
// statements

update_expression;
}
The various parts of the While loop are:

Test Expression: In this expression we have to test the condition. If the condition evaluates to true then we will execute the body of the loop and go to update expression. Otherwise, we will exit from the while loop.

Update Expression: After executing the loop body, this expression increments/decrements the loop variable by some value.

Java do-while loop is an Exit control loop. Therefore, unlike for or while loop, a do-while check for the condition after executing the statements or the loop body.

Syntax:

do
{
// loop body

update_expression
}
while (test_expression);

The various parts of the do-while loop are:

Test Expression: In this expression we have to test the condition. If the condition evaluates to true then we will execute the body of the loop and go to update expression. Otherwise, we will exit from the while loop.


Update Expression: After executing the loop body, this expression increments/decrements the loop variable by some value.


On this page of the site you can watch the video online Java Tutorial: While Loop and do-while loop in Java | Difference between while loop & do while loop with a duration of online in good quality, which was uploaded by the user Parnika Tutorials 25 January 2022, share the link with friends and acquaintances, this video has already been watched 304 times on youtube and it was liked by 9 viewers. Enjoy your viewing!