title: Accessing Inner Object Class Variables
body: <p>In my main class, I have an inner class called Shape which extends JButton. This inner class has a private char variable that goes by the name of CUBE.</p>
  
  <p>I wrote getters and setters for it.  I noticed that in the main method, instead of using:</p>
  
  <pre><code>(instance of Shape).getCUBE(); 
  </code></pre>
  
  <p>I can access it by using:</p>
  
  <pre><code>(instance of Shape).CUBE
  </code></pre>
  
  <p>Does this happen because CUBE is ultimately in the same class as main? </p>
  
  <p>Is it necessary by java programming conventions that I write getters and setters for such an inner class?</p>