just wondering if I could get some help.
I am trying to call the following method:
public void updateBrand(Scanner input){
System.out.println("1 - HIGHSTREET\n2 - FRENCHCONNECTION\n3 - TEDBAKER\nSelect type of brand (Enter number)");
int choice = input.nextInt();
switch (choice) {
case (1):
setBrand(Brand.highstreet);
System.out.println("Brand of has been changed to HIGHSTREET");
break;
case (2):
setBrand(Brand.frenchconnection);
System.out.println("Brand of has been changed to FRENCHCONNECTION");
break;
case (3):
setBrand(Brand.tedbaker);
System.out.println("Brand of has been changed to TEDBAKER");
break;
default: System.out.println("Invalid input");
break;
}
}
from my MorningSuit subclass to a method in my Suit Super class:
public void makeChange(Scanner input){
System.out.println("Are you sure you want to change this suit? (y or n)");
String choice;
choice = input.next();
if (choice.toLowerCase() == "y") {
updateBrand(input);
}
else if (choice.toLowerCase() == "n") {
System.exit(0);
}
else {
System.out.println("Invalid Input");
}
}
But I am receiving an error when I try to call the updateBrand(input) method in my super class as it doesn't think it exists. How would I fix this?