/*WAP To print elements of array*/
/*SAVE AS: PrintArray.java*/
import java.lang.*; class Array { int l[]; Array() { l=new int[] {1,2,3,4,5,6,7,8,9}; } void display() { for(int i=0;i<9;i++) { System.out.print(" "+l[i]); } } } class PrintArray { public static void main(String arg[]) { Array a1=new Array(); a1.display(); } }
No comments:
Post a Comment