title: Create a method with 2 integers as parameters
body: <p>I am practicing on methods and the question is:</p>
  
  <blockquote>
    <p>Create a method <code>getMax()</code> with 2 integers as parameters which returns the higher value</p>
  </blockquote>
  
  <p>No problem here but the next part is a bit tricky for me:</p>
  
  <blockquote>
    <p>Create a Java program which reads 3 integers from the console and returns the highest of the 3 using the method <code>getMax()</code></p>
  </blockquote>
  
  <p>Here is what I have so far. I have a problem with that the method I create is using 2 variables but then in the main method I have to use it with 3 integers.<br>
  How come the method will calculate it since I've only assigned it with a 1 IF and 1 ELSE operation.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class zadacha2 {
  
      public static int getMax(int num1, int num2) {
          if (num1 &gt; num2)
              return num1;
          else
              return num2;
      }
  
      public static void main(String[] args) {
          int num1, num2, num3;
          System.out.println("Enther the num1, num2 and num3 variables");
          Scanner input = new Scanner(System.in);
          num1 = input.nextInt();
          num2 = input.nextInt();
          num3 = input.nextInt();
          System.out.println("the bigger value of the two is:" + getMax(num1, num2, num3));
      }
  }
  </code></pre>