title: My 'if' statements are being totally skipped in Java. How can I get them to be acknowledged? What is the issue?
body: <p>import java.util.Scanner;</p>
  
  <p>public class Class_3_26 {</p>
  
  <pre><code>public static void type() {
      System.out.println("Student or Teacher?");
      Scanner input = new Scanner(System.in);
      String userInput = input.next();
      if (userInput == "Student") {
          student("Jono", 12);
      }
      if (userInput == "Teacher") {
          teacher("Mr. Fomenko", "Technology");
      }
      else {
          System.out.println("DOES NOT COMPUTE");
          System.out.println("TRY AGAIN");
          type();
      }
  }
  
  public static void student(String name, int grade) {
      System.out.println(name + " is a student at Waterford High School. This person is in grade " + grade + ".");
  }
  
  public static void teacher(String name, String subject) {
      System.out.println(name + " is a teacher at Waterford High School. This person teaches " + subject + "class.");
  }
  
  
  
  public static void main(String[] args) {
      type();
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>So here is my code. I am doing this for a project in class and for some reason, the IFs are just being skipped over. No matter what you input, even if it's "Student" or "Teacher" which should be correct, it prints the else. Any ideas?</p>