Package trial.gaurav.menu
Class MenuItem
java.lang.Object
trial.gaurav.menu.MenuItem
The `MenuItem` class represents an item in the menu with a unique choice number, a name, and an associated action.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
choice
private int choice -
name
-
action
-
-
Constructor Details
-
Method Details
-
display
public void display()Displays the menu item on the console. The menu item is displayed in the format: "choice. name". -
getChoice
public int getChoice()Gets the choice number of the menu item.- Returns:
- The choice number of the menu item.
-