title: Need help: input int from console and pass it into method in different class
body: <p>I'm a beginner. I want to read a number <code>a</code> from the console and then store them in variable to use as passing to a different class (different <code>.java</code> file).</p>
  
  <p>How do I code the 2 classes? </p>
  
  <pre><code>public class PassedInMethod{ 
  
     private int a;
  
     public PAssMethod(int a) { 
        a = a; // TODO: where to get the a? 
        System.out.println("a was passed in!"+a);
     }
  } 
  
  
  
  public class Mainclass {
  
    public static void main( String args[] ) {
        Scanner input = new Scanner( System.in );
  
        int a;
  
        System.out.print( "Enter your nember: " );
        a = input.nextInt();
  
        PassedInMethod(int a);
     }
  }
  </code></pre>