static <A> void printArray(A[] as){ int i=0; try{ while (true){ System.out.println(as[i]); i=i+1; } }catch (ArrayIndexOutOfBoundsException ex){} }