课程: Hands-On Introduction: Java
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Create menu
- [Instructor] In order for people to use our application, we need to provide a user interface for them. Most applications provide a graphical user interface with form elements such as menu options, text boxes, and buttons. However, to keep things simple we're going to build a text-based user interface that allows the user to enter their credentials and specify what type of transaction they'd like to make. Let's create a new class called Menu under the bank package. So we'll click this plus sign and let's name it Menu. In order to receive input from the text console we can use Java's built-in Scanner class. Let's declare a Scanner object now. So we can say private Scanner and we'll call it scanner. Now let's create a main method. Remember, the main method is the starting point of Java applications. And we need to import the Scanner class and we can do so from the Java util package. Now let's create a main method.…