user

mail@pastecode.io avatar
unknown
java
a month ago
516 B
2
Indexable
Never
package assignments.assignment3.systemCLI;

import java.util.Scanner;

public abstract class UserSystemCLI {
    protected Scanner input = new Scanner(System.in);

    public void run() {
        boolean isLoggedIn = true;
        while (isLoggedIn) {
            displayMenu();
            int command = input.nextInt();
            input.nextLine();
            isLoggedIn = handleMenu(command);
        }
    }

    abstract void displayMenu();
    abstract boolean handleMenu(int command);
}
Leave a Comment