Here you can find the source of arrayDimension(String clsName)
Parameter | Description |
---|---|
clsName | name, e.g., <code>[[I</code> or <code>[LString;</code> |
private static int arrayDimension(String clsName)
//package com.java2s; public class Main { /**//from ww w . j a v a2 s . co m * Computes the dimension of the array class specified by name. * * @param clsName name, e.g., * <code>[[I</code> or * <code>[LString;</code> * @return the dimension of the array class specified by name */ private static int arrayDimension(String clsName) { int arrayDim = 0; // is array if (clsName.startsWith("[")) { // compute array dim for (int i = 0; i < clsName.length(); i++) { if (clsName.charAt(i) != '[') { break; } arrayDim = i + 1; } } return arrayDim; } }