+ 1
Please code an indefinite for loop printing your name
2 Answers
+ 2
public void infiniteLoop(){
while(true) {
System.out.println("your name");
}}
Ive also seen some people do
for(;;){
// your infinite logic here
}
0
for(i=0;i<=5;i--)
System.out.println("your name");
in this the value of i will never reach five and hence the condition always remains true and loop will kept on executing.
you can also emit the increement part fro infinite for loop.