title: What alternatives are there for if else statements?
body: <p>This is a method within my program and I cannot use a bunch of <code>if-else</code> statements for my code. I need alternatives.</p>
  
  <pre><code>    public String bedRoom1(){
  
          int newChoice10 = JOptionPane.showConfirmDialog(null,"Would "
          + "you like to explore this room?",
          "question",JOptionPane.YES_NO_OPTION);
  
  
          if (newChoice10 == JOptionPane.YES_OPTION){  //if the user would lieke to
      // explore then they are given the option for which objects they woul like to explore
  
              int newChoice4 = JOptionPane.showConfirmDialog(null,"Explore"
               + " the Rocking chair(type YES) or Window(type NO)?"
               , "question",JOptionPane.YES_NO_OPTION);
  
      //The following if else statments are still within
       //the first statement of the first if statement
              if (newChoice4 == JOptionPane.YES_OPTION){
                  JOptionPane.showMessageDialog(null,"Chair starts "
                 + "rocking with no one in it");
  
              }else{
  
                  JOptionPane.showMessageDialog(null, "You see a child outs"
                    + "ide on a swing and he suddenly vanishes.");
              }
          }else if (newChoice10 == JOptionPane.NO_OPTION){
              JOptionPane.showMessageDialog(null,"You have chosen not "
           + "to explore Bedroom 1 and therefore continue "
           + "into the following room");
  
          }
  
          return null;
  
  
  
    }
  </code></pre>
  
  <p>Can you please provide examples. Thank you in advance.</p>