Question: I need help to do a do while loop on a java code. I want it to do loop a method the user just types

I need help to do a do while loop on a java code. I want it to do loop a method the user just types yes or Yes to run the loop again. I need to use an ignoreequalcase, but I don't know how to work it. This is what I have.

public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String answer; do { switchCase(); System.out.print("Enter \"Yes\" to go again."); answer=keyboard.next(); } while(answer=="Yes");//Work on making it to where both yes and Yes are equal }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!