title: java.lang.NullPointerException error in methods
body: <p>What is causing my error???</p>
  
  <pre><code>public class Keyboard {
      private Scanner keyboard;
  
      /**
       * Default contructor
       */
      public void keyboard() {
          keyboard = new Scanner(System.in);
      }
  
      /**
       * get and return an int
       * @return an int
       */
      public int getInt() {
          int myInt;
          myInt = keyboard.nextInt();
          keyboard.nextLine();
  
          return myInt;
      }
  }
  
  public class TestKeyboard {
      public static void main(String[] args) {
          System.out.println("enter an int: ");
          Keyboard keyboard = new Keyboard();
          keyboard.getInt();
      }
  }
  </code></pre>
  
  <p>I am currently getting the following exception:</p>
  
  <blockquote>
    <p>java.lang.NullPointerException at Keyboard.getInt(Keyboard.java:27)
        at TestKeyboard.main(TestKeyboard.java:6)</p>
  </blockquote>