title: Use of Global variables
body: <p>Why is it that when I read others code I frequently see extensive use of "Global variables"?</p>
  
  <p>For instance in Java code:</p>
  
  <pre><code>public class SomeClass {
     Button btn1;
     private void someMethod() {
         btn = new Button();
     }
  }
  </code></pre>
  
  <p><code>btn1</code> is declared as "global" and a "convenient" variable to be used as easy access throughout the class. But when there is no modifier on it, it defaults to default access in Java.</p>
  
  <p>Could this be a security risk? Why don't people declare them with private modifier right away if they are only planning to use them in only one specific class?</p>