title: Java language convention; getters/setters
body: <pre><code>Public class Example {
  
      private int number;
  
      public Example(int number){
          this.number = number;
      }
  
      public int getNumber(){
          return number;
      }
  
      public void setNumber(int number){
          this.number = number;
      }
  
      public static void main(String[] args){
          Example e = new Example(5);
  </code></pre>
  
  <p>What is preffered when accessing a variable within its own class;
  "e.number" or "e.getNumber()" ?</p>
  
  <p><strong>Edit</strong>:<br>
  I think the most important question is: does the compiler know the method you call is a getter or setter. So, will <code>e.setNumber(5);</code> be as fast as <code>e.number = 5;</code></p>