The Java while loop is used to iterate a part of the program several times. If the number of iteration is not fixed, it is recommended to use while loop.
Java Infinitive While Loop
If you pass true in the while loop, it will be infinitive while loop.
Now, you need to press ctrl+c to exit from the program