/*****************************************************************
** DemoMethod -demonstrate the definition  and use of a method
**
** Two integers are read from the console.  A method is used to
** determine which is larger.  Two ints are passed to the function
** (the two integers read) and an int is returned from the
** function (the larger of the two integers).
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.io.*;

public class DemoMethod
{
   public static void main(String[] args) throws IOException
   {
      BufferedReader stdin =
         new BufferedReader(new InputStreamReader(System.in), 1);

      System.out.print("Enter an integer: ");
      int x = Integer.parseInt(stdin.readLine());

      System.out.print("Enter another one: ");
      int y = Integer.parseInt(stdin.readLine());

      int z = DemoMethod.largerOf(x, y);
      System.out.println("The larger one is " + z);
   }

   public static int largerOf(int a, int b)
   {
      if (a > b)
         return a;
      else
         return b;
   }
}

