title: Proper way of getting variable from another class
body: <p>I can call variables 2 ways.</p>
  
  <p>One is just to do it like this:</p>
  
  <pre><code>MyClass myClass = new MyClass();    
  
  myLocalVar = myClass.myVarVal;
  </code></pre>
  
  <p>And the other way is to use a getter like this:</p>
  
  <pre><code>myLocalVar = myClass.getMyVarVal();
  </code></pre>
  
  <p>Both ways are working fine, but I was wondering what would be the most efficient/proper way of doing this?</p>
  
  <p>Thanks</p>