I have a do While loop as follow:
do{
System.out.println("Enter customer type (r/c/t): ");
customerType = sc.next();
}
while(customerType !="r");
I am expecting the program to loop as long as I don't type r when the program prompts me so. However the program still loops when I type r, I am not sure why, hope someone can help. Thank you.