public static int arrayDimensions ( Class < ? > arrType ) { if ( null == arrType || ! arrType . isArray ( ) ) return 0 ; return arrType . getName ( ) . lastIndexOf ( ' ' ) + 1 ; }
Find the number of array dimensions for class . By counting the number of [ prefixing the class name .