-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExample3.java
More file actions
29 lines (22 loc) · 787 Bytes
/
Example3.java
File metadata and controls
29 lines (22 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package whileGita;
import java.util.Scanner;
public class Example3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (true) {
System.out.println("1. Start Game");
System.out.println("2. Lead board");
System.out.println("3. About");
System.out.println("4. Exit");
System.out.print("Select menu, please: ");
int input = scanner.nextInt();
if (input == 1) System.out.println("Start game");
if (input == 2) System.out.println("Lead board");
if (input == 3) System.out.println("About");
if (input == 4) {
System.out.println("Exit");
break;
}
}
}
}