Как получить класс массива для данного класса в Java? ⇐ JAVA
-
Anonymous
Как получить класс массива для данного класса в Java?
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this:
Class arrayOfFooClass = java.lang.reflect.Array.newInstance(fooClass, 0).getClass(); Is there a way to do this without creating the new instance?
Источник: https://stackoverflow.com/questions/167 ... ss-in-java
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this:
Class arrayOfFooClass = java.lang.reflect.Array.newInstance(fooClass, 0).getClass(); Is there a way to do this without creating the new instance?
Источник: https://stackoverflow.com/questions/167 ... ss-in-java
Мобильная версия