Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Application {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("Please enter a command: ");
- String text = input.nextLine();
- switch(text) {
- case "start":
- System.out.println("Machine started!");
- break;
- case "stop":
- System.out.println("Machine Stopped.");
- break;
- default:
- System.out.println("command not recognised");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement