Here you can find the source of arrayDim(Class> c)
public static int arrayDim(Class<?> c)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Andre L. Santos.//from w w w . ja va 2 s . c om * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Andre L Santos - developer ******************************************************************************/ public class Main { public static int arrayDim(Class<?> c) { if (c.isArray() && !c.getComponentType().isArray()) return 1; else return 1 + arrayDim(c.getComponentType()); } }