Search 800 + Posts

Feb 22, 2011

Sample Code about how to use Array in Java

package java_testArry;

public class srarray {
    public srarray() {
        super();
    }
   
public static void main(String[] args){
     int i =90;
     int[] i_arry;
     int i_index  =5;
     i_arry = new int[i_index];
     System.out.println("Integer Value -"+i);
     for (i =0; i<=i_index-1;i++)
        {    
       i_arry[i] = i;
        //System.out.println("Array value -"+i_arry);
    }
  for (i =0; i<=i_index-1;i++) {
    System.out.println("Array value -"+i_arry[i]);
  }
}
}

No comments:

Post a Comment