Sunday, September 20, 2015

Example on Arrays in java


 

public class Apples {



public static void main(String[] args){

int[] array;

array = new int[10];

System.out.printf("%s%8s \n","inex" , "value" );   // putting headlines



for (int counter=0 ; counter < array.length ; counter ++)     // printing the array out



System.out.printf("%5d%8d \n" , counter , array[counter]);



}

}

1 comment:

  1. This was a good class , it is coming along well. Ilook forward to the next class .

    ReplyDelete