Android examples for java.lang:array
get Array Dimension from its to String representation
import android.util.Pair; import java.util.Arrays; public class Main{ public static int getArrayDimension(Object objects) { int dim = 0; for (int i = 0; i < objects.toString().length(); ++i) { if (objects.toString().charAt(i) == '[') { ++dim;/*ww w . j av a 2s . c o m*/ } else { break; } } return dim; } }