jeudi 30 avril 2015

cannot get package name if object class is array on field using java reflection

I have some problem.

class example{
     JLabel[] label=new JLabel[3];
}

so, i have tried reflection :

Class cls=Class.forName("example");
Field[]f=cls.getDeclaredFields();
for(field : f)
     field.getType().getPackage();

the result is null





Aucun commentaire:

Enregistrer un commentaire