I am having doubt on below code which uses parameter as java.lang.reflect.Array
.
public static void display(java.lang.reflect.Array stringArray) {
System.out.println(java.lang.reflect.Array.get(stringArray, 1));
}
Above mentioned code will compile successfully but whether i should write this method and what could be the possible use-case?
if i can write such method how can we call this method however we can not instantiate java.lang.reflect.Array
and also we can not get object from Class
class reference as we can get java.lang.reflect.Field
object.
Aucun commentaire:
Enregistrer un commentaire