1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
/* Infinite For loop Example This Java Example shows how to create a for loop that runs infinite times in Java program. It happens when the loop condition is always evaluated as true. */ public class InfiniteForLoop { public static void main(String[] args) { /* * Its perfectely legal to skip any of the 3 parts of the for loop. * Below given for loop will run infinite times. */ for(;;) System.out.println("Hello"); /* * To terminate this program press ctrl + c in the console. */ } } /* Output would be Hello Hello Hello Hello .. .. */ |
Thanks. 🙂
Example Program To kam se sahi likho , 1 program mai 2 public class nahi allowed hoti You duffer, developer