Here you can find the source of arrayLenght(Object array)
public static int arrayLenght(Object array)
//package com.java2s; //License from project: Apache License public class Main { public static int arrayLenght(Object array) { if (array instanceof Object[]) { return ((Object[]) array).length; } else if (array instanceof int[]) { return ((int[]) array).length; } else if (array instanceof long[]) { return ((long[]) array).length; } else if (array instanceof double[]) { return ((double[]) array).length; } else if (array instanceof float[]) { return ((float[]) array).length; } else if (array instanceof boolean[]) { return ((boolean[]) array).length; } else if (array instanceof byte[]) { return ((byte[]) array).length; } else if (array instanceof char[]) { return ((char[]) array).length; } else if (array instanceof short[]) { return ((short[]) array).length; }//from www .j a v a 2s . c o m return 0; } }