You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will generate a public final int GAMEFIELD_WIDTH without a getter, while the class' toString() still attempts to call it:
game.createAttribute("GAMEFIELD_WIDTH", DataType.INT)
.withInitialization("20")
.with(Visibility.FINAL); // kills the getter
Furthermore, this will get you a public static int GAMEFIELD_WIDTH instead of a public static final int:
game.createAttribute("GAMEFIELD_WIDTH", DataType.INT)
.withInitialization("20")
.with(Visibility.FINAL)
.with(Visibility.STATIC); // kills the final modifier
The text was updated successfully, but these errors were encountered:
This works as expected, yielding a
private int GAMEFIELD_WIDTH
with getter and setter:This will generate a
public final int GAMEFIELD_WIDTH
without a getter, while the class' toString() still attempts to call it:Furthermore, this will get you a
public static int GAMEFIELD_WIDTH
instead of a public static final int:The text was updated successfully, but these errors were encountered: