title: How to call a method from the same class in Java?
body: <p>How can I call getDummy from main? I need this so I can pass dummy to a method in another class.</p>
  
  <pre><code>public class Test {
      public static void main(String[] args) {
          private int dummy = 0;
      }
  
      public int getDummy() {
          return dummy;
      }
  }
  </code></pre>