How can you identify an infinite loop in java code example
Example 1: write an infinite loop java
while(true) {
//do whatever
}
Example 2: java infinite for loop
for(int i=0;i!=0;i++) return;
while(true) {
//do whatever
}
for(int i=0;i!=0;i++) return;