Can a for loop be written in Java to create an infinite loop or is it only while loops that cause that problem?
Ofcourse for loops can cause infinite loops. An example is:
for(int i = 0; i < 99; i /= 2){ ... }
Because i is never incremented, it will stay in the body of the for loop forever until you quit the program.
i
for