// Some examples of infinite loops. public class Infinite { public static void main(String[] args) { /* for (int i = 1; i <= 10; i++) { for (int j = 1; i <= 5; j++) { System.out.println(j); } System.out.println(); } */ //----------------------------- /* for (int i = 10; i >= 1; i++) { System.out.println(i); } */ //----------------------------- /* int x = -1; while (x < 0) { System.out.println("Negative"); } */ //------------------------------- while (true) { System.out.println("Negative"); } } }