Class Menu

java.lang.Object
trial.gaurav.menu.Menu
Direct Known Subclasses:
CustomerMenu

public class Menu extends Object
The `Menu` class provides functionality to display a menu and interact with the user's choices. It uses a linked list of `MenuItem` objects to store and display the menu items.
  • Field Details

  • Constructor Details

    • Menu

      public Menu()
      Constructs a new `Menu` object with an empty list of menu items and a new `Scanner` for user input.
  • Method Details

    • display

      public void display()
      Displays the menu and handles user interaction. The user is prompted to enter their choice, and the corresponding action is executed.
    • collectUserChoice

      public int collectUserChoice()
      Collects the user's choice from the console.
      Returns:
      The user's choice as an integer.