Loops can execute block of code as long as a specified condition is reached.
loops offer, including efficient code execution, time-saving, improved readability, and versatility.
There are three types of loops in Java.
Java For Loop:
A simple for loop is the same as C / C++.It consist of four parts.
1.Initialization: It is the initial condition which is executed once when the loop starts. Here we can initialize variable and if we have already initialized we can use it.