[Solved] If else statements and subStrings (new to programming in Java)


You should print the prompt before you accept user input, otherwise you won’t know what you are entering. For example, in your code

String Destination = S.nextLine();
System.out.println("Specify :" + Destination);

That first line will halt and wait for output with no prompt as what to enter.

Changing around a few lines should get you your expected results.

System.out.print("Specify Destination: ");
String Destination = S.nextLine();

System.out.print("Specify Max Time (HH:MM): ");
String specificTime = S.nextLine();

1

solved If else statements and subStrings (new to programming in Java)