title: Leap year program problems- cant seem to get it to run right
body: <p>I am supposed to Design a program that asks the user to enter a year and then determine if that year is a leap year using for methods, but I can't seem to  get it to work. It ran the first time I complied, but it did not work the way I wanted it to. Now I made some changes and it's not running at all. What am I doing wrong? I must have four methods.</p>
  
  <p>displayInstructions </p>
  
  <p>isLeap </p>
  
  <p>getYear</p>
  
  <p>displayResults </p>
  
  <pre><code>import java.util.Scanner;
  public class LeapYearr
  {
      public static void main(String[] args)
      {
  
  
          //Create a Scanner object for keyboard input.
          Scanner keyboard = new Scanner(System.in);
  
        int Year;
          displayInstructions();
          Year = getYear();
          boolean leapYear;
          leapYear = isLeap (Year);
  
  
      }
  
      public static void displayInstructions()
      {
           System.out.println("This program allows a users to enter a year then" +
                                      " the program determines weather or not the year entered" +
                                      "is leap Year or is not. ");
      }
  
      public static int getYear()
  
      {
      Scanner keyboard = new Scanner(System.in);
  
         int Year;
         System.out.print("Enter a Year of your choice: ");
          System.out.println("");
          System.out.println("");
        Year = keyboard.nextInt();
  
            while(Year&lt;1000||Year&gt;9999)
            {
  
                System.out.println("Invalid entry. Year has to be a 4 Digit Number!!");
                     System.out.println("");
                 System.out.print("Enter a Year of your choice: ");
                      System.out.println("");
             Year = keyboard.nextInt;
               }
  
  
  
      return Year;
      }
  
      public static boolean isLeap (int Year)
      {
          if (Year % 4 != 0)
          {
              return false;
          }
          else if (Year % 400 == 0)
          {
              return true;
          }
          else if (Year % 100 == 0)
          {
              return false;
          }
          else
          {
              return true;
          }
      }
      public static void displayResults( boolean leapYear, int Year)
      {
          if (isLeapYear(Year))
          {
               System.out.println(Year + "is a leap Year.");
          }
          else
          {
               System.out.println(Year + "is not a leap Year.");
          }
      }
  }
  </code></pre>