String input1 = in.next(); if (input1 == "y"){ System.out.print("Yay. \n"); } else { System.out.print("Alright, Bye. \n"); }