Question: Why can't I input anything in the console? import java.util.Scanner; public class CourseSearchApplication { public static void main(String[] args) { publ public String courseSearch() {

Why can't I input anything in the console?
import java.util.Scanner; public class CourseSearchApplication { public static void main(String[] args) { publ public String courseSearch() { System.out.println("1. Search by Course Name 2. Search by Course Number 3. Search ! String one = "Enter all or part of course name to search for: "; String two = "Enter all or part of course number to search for: "; String three = "Enter all or part of term to search for (s->Spring; f->Fall; r->Summe String four = "Enter year to search";|| String five = "Goodbye"; Scanner scan = new Scanner(System.in); String input = scan.nextLine(); if (input == "1") { return one;} if (input == "2") { return two;} if (input "3") { return three;} if (input == "4") { return four;} if (input == "5") { return five;} else { return "Invalid input"; } ==
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
