Use for loops without bodies to print the numbers 1 to 10 on the console - Java Language Basics

Java examples for Language Basics:for

Description

Use for loops without bodies to print the numbers 1 to 10 on the console

Demo Code

public class TerseCoder{
  public static void main(String[] args){
    for (int i = 1; i <=10; System.out.println(i++));
  }/*from  w  ww  .  j av a 2s  .c o m*/
}

Related Tutorials