Learn How to iterate java arrays
Learn How to iterate java arrayspublic class array1 { public static void main(String[] args) { int ar[]={4,5,6,88,9,1}; for(int x:ar) System.out.print(x+"\t"); } }
import java.util.*; public class array2 { public static void main(String[] args) { int ar[]={4,5,6,88,9,1}; List list=new ArrayList(); for (int i = 0; i < ar.length; i++) { list.add(ar[i]); } Iterator i=list.iterator(); while(i.hasNext()) System.out.print(i.next()+"\t"); } }