Syntax error Incremental Java infinite loop

Incremental Java infinite loop



Example

Following is the required program −

Live Demo

public class Tester {
   public static void main(String args[]) {
      int i = 0;
      do {
         i++;
         System.out.println(i);
      }while (true);
   }
}

The output will keep printing numbers in sequential order.



Updated on: 2020-03-12T12:18:35+05:30

215 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements