title: If option works but else if does not
body: <p>i have a method i am working on, its part of a larger program but i think the code i posted will be enough.</p>
  
  <p>When i select option 1 in my menu, it works as it should, but when i select option 2 , it just ends the program. can anybody spot the issue?</p>
  
  <p>Resolved : the choice == 1 should be 2.</p>
  
  <p>Can i also add to this question, would it be best to put the in putted data into an array, if so, should i declare the array in the main class,superclass or the Sub class</p>
  
  <pre><code>static void addBook(){
              String title,author;
              int choice;
              boolean onLoan;
              loanbook book1; // TESTING ONLY
              System.out.print("Press 1 for Fiction or 2 for Non Fiction: ");  // sub menu for fiction and non fiction
              choice = keyboard.nextInt();
              if (choice == 1){
  
                  System.out.println("Please enter book title: ");
                  title = keyboard.nextLine();
                  title = keyboard.nextLine();
                  System.out.println("Please enter book author: ");
                  author = keyboard.nextLine();
                  onLoan = false; // not used yet
                  book1 = new fiction(title,author);
                  System.out.println(book1.toString());
          }
              else if (choice == 1) {
                  System.out.println("Please enter book title: ");
                  title = keyboard.nextLine();
                  title = keyboard.nextLine();                ;
                  System.out.println("Please enter book author: ");
                  author = keyboard.nextLine();
                  onLoan = false; // not used yet
                  book1 = new nonfiction(title,author);
                  System.out.println(book1.toString());
              }
  
          }
  </code></pre>