Java tutorial
//package com.java2s; public class Main { private static int getArrayDimension(Object object) { int dim = 0; for (int i = 0; i < object.toString().length(); ++i) { if (object.toString().charAt(i) == '[') { ++dim; } else { break; } } return dim; } }