java - input.equals("string here") not working -


i new java. i'm trying make program user inputs country , returns current time in country. have code:

public static void main(string[] args) {     scanner userinput = new scanner(system.in);      system.out.println("enter country: ");     string usercountryinput = userinput.nextline();      if (userinput.equals("philippines")) {         date date1 = new date();         system.out.println(date1);     }      if (userinput.equals("russia")) {         timezone.setdefault(timezone.gettimezone("utc + 05:30"));          date date2 = new date();         system.out.println(date2);     } } 

when enter "russia" or "philippines" not output anything. idea why?

usercountryinput input variable. userinput scanner variable used input

if ("philippines".equals(usercountryinput)) { 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -