I want to use getFields()
to retrieve public fields in a class but this is not working, the lenght of the array is always 0
. Do I need to use getters or getDeclaredFields()
?
Field[] fields = gameClass.getFields();
The class contained in gameClass :
public class Solitaire {
public Board board = new Board("Board1", "");
public Layout layout = new Layout();
public Player player = new Player();}
Here how the class is loaded into gameClass : Load a class in a jar just with his name