#17 While Loop in Java
300.7K views on YouTube
Check out our courses:
Agentic AI Engineering with Python : https://go.telusko.com/agentic-ai-python
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : https://go.telusko.com/learn-master
Coupon: TELUSKO10 (10% Discount)
For More Queries WhatsApp or Call on : +919008963671
website : https://telusko.com/
Udemy Courses:
Java Spring:- https://go.telusko.com/Udemyjavaspring
Java:- https://go.telusko.com/udemyteluskojava
Spring: https://go.telusko.com/udemyteluskospring
Java For Programmers:- https://go.telusko.com/javaProgrammers
Python : https://go.telusko.com/udemyteluskopython
Git : https://go.telusko.com/udemyteluskogit
Docker : https://go.telusko.com/udemyteluskodocker
Instagram : https://www.instagram.com/navinreddyofficial/
Linkedin : https://in.linkedin.com/in/navinreddy20
WhatsApp : https://go.telusko.com/whatsapp
Discord : https://discord.gg/D8hWe9BqfF
In this lecture we will learn:
– While loop in Java
– When to use the while loop?
– Syntax of while loop
– Nested loops
Loops can be used when we have to repeat something.
#1
While loop:-
– While loop is used with a condition. We need to provide a condition inside the while loop.
– If we will give the condition as true inside the while loop then it will infinite times.
-If we do not provide any condition inside the while loop then it is known as an empty loop.
– We require an iterator inside the loop to execute the statements.
— We use plus opertaor(+) for concatenation. When we have to concatenate or join two things, we simply use plus operator.
– We need to put the condition inside the while loop for executing statements. We run the loop until the condition gets false.
– When the condition inside the while loops get false, then after that it will not execute the statement of the block and the iterator directly jumps out of the block.
– The while loop is used when the number of iterations is unknown but the terminating condition is known.
– While loop is also an entry-controlled loop as the condition is checked before entering the loop. The test condition is checked first and then the control goes inside the loop.
Syntax of while loop:-
while(condition)
{
statements;
}
#2
Nested loops:-
– We can also use a loop inside another loop statement. A loop inside another loop is known as a nested loop.
– There can be any number of inner loops inside an outer loop.
Github repo : https://github.com/navinreddy20/Javacode.git
More Learning :
Java :- https://bit.ly/3x6rr0N
Python :- https://bit.ly/3GRc7JX
Django :- https://bit.ly/3MmoJK6
JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq
Rest Api :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA
Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB
NoSQL Tutorial :- https://bit.ly/3aJpRuc
Mysql Tutorial :- https://bit.ly/3thpr4L
Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
https://www.telusko.com