In my main class, I have an inner Shape class that extends JButton. This inner class has a private variable called char called CUBE.
I wrote getters and setters for this. I noticed that in the main method, instead of using:
(instance of Shape).getCUBE();
I can access it using:
(instance of Shape).CUBE
Is this because CUBE ends up in the same class as the main one?
Do I need to write getters and setters for such an inner class using java software conventions?
Zenos source
share