A simple for loop that displays the numbers 1to 10 on the console - Java Language Basics

Java examples for Language Basics:for

Description

A simple for loop that displays the numbers 1to 10 on the console

Demo Code

public class CountToTen{
  public static void main(String[] args){
    for (int i = 1; i <=10; i++)
      System.out.println(i);/*from  w  w  w .  ja  v  a2 s  .  c  o m*/
  }
}

Related Tutorials