int length = 0; for(int idx = 0; idx < a.length; i++) { length++; } System.out.println("length is : " + length);