Java examples for Language Basics:for
A simple for loop that displays the numbers 1to 10 on the console
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*/ } }