How to return an Int from one method to another in java : <pre><code>public static void main(){
  getNumber();
  printNumber();
  int x;
}

public static int getNumber(){
  int x = 5;
  return(x);
}

public static void printNumber(){

  System.out.println(x);
}
</code></pre>

<p>I am a total beginner, sorry for such a simple question. The above fragment of code is what I tried.</p>
