title: Using multiple classes in java?
body: <p>Im learning the basics of java and i cant at all figure out why i cant use a class inside a main method. can someone please tell me where my code went wrong?</p>
  
  <p>main class</p>
  
  <hr>
  
  <pre><code>package Base;
      class Game {
          public static void main(String[] args){ 
              Data gameData = new Data();
              gameData.test();
              System.out.println(score);
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>package Base;
  
  public class Data {
      public void test(){
          int score = 100;
  
      }
  }
  </code></pre>