I am making a console application. I want to make a method to stop the application. Can anyone help please.
This is my code.
public void menu() {
System.out.println("1 to go to menu help, 2 to go to head menu 3 to stop");
int optie = scanner.nextInt();
switch (optie) {
case (1):
menuHelp();
break;
case (2):
showMenu();
case (3):
menuStop();
default:
System.out.println("ERROR: invalid value");
clearScreen();
}
}
how do i make menuStop?
public void menuStop(){
// What to do here??
}