title: If and Switch same task, different results?
body: <p>I have a switch and an if statement, and they are equivalent. They should both take a string, if yes do something, and if no do another thing. The if statement does nothing regardless of what is entered, but the switch statement does. Why is that?</p>
  
  <p>Here is the if statement:</p>
  
  <pre><code>if (yes.equals("yes")){
      System.out.println ("Enter your first number");
      fnum = x.nextDouble();
      System.out.println ("Enter your second number");
      snum = x.nextDouble();
      calculations(fnum, snum);
  }
  if (yes.equals("No")) {
      System.out.println("okay, bye then!");
  }
  </code></pre>
  
  <p>Here is the switch:</p>
  
  <pre><code>switch (yesno){
      case "yes":  
          System.out.println ("Enter your first number");
          fnum = x.nextDouble();
          System.out.println ("Enter your second number");
          snum = x.nextDouble();
          calculations(fnum, snum);
          break;
      case "no":
          System.out.println("k bye");
  </code></pre>
  
  <p><strong>This is not a duplicate, because the issue is in the if statement. I have been marked duplicate for my switch.</strong></p>