dimanche 12 avril 2015

'[L' prefix in Java reflection

Using Java6 reflection API, Class.getDeclaredFields returns pretty weird values. Example of class field:



protected String[] arrF = new String[15];


Using getDeclaredFields on proper Class, a Field is returned:



  • name = arrF

  • type = [Ljava.lang.String;


The question: does [L prefix mean that the arrF is an array? Can I always rely on that, i.e. the field is an array iff type is prefixed with [L? If no, how can I get some information about "arrayness" of the field?






Aucun commentaire:

Enregistrer un commentaire