Skip to content Skip to sidebar Skip to footer

Android, Couldn't Make Static Getter Setter Property Work?

I was trying this ... public class Info { private static Info ourInstance = new Info(); public static Info getInstance() { return ourInstance; } private static int cur

Solution 1:

Why do you define the setter/getter if you are going to end up doing this?

Info.currentIndex = 666;

if so, then change currentIndex visibility to public...

or even better, be congruent with the code and do

Info.setCurrentIndex(666);

Post a Comment for "Android, Couldn't Make Static Getter Setter Property Work?"