Question: why is my while loop not catching my Y string?? System.out.print(Hello! Welcome, would you like to create an account? Enter 'Y' or 'N': ); //choice
why is my while loop not catching my Y string??

System.out.print("Hello! Welcome, would you like to create an account? Enter 'Y' or 'N': "); //choice to create a profile choice = input.nextLine(); while(choice=="y") { System.out.println("Enter your first name: "); String first = input.next(); System.out.println("Enter your last name: "); String last = input.next(); Name ProfileName = new Name(first, last)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
