Guest User

Untitled

a guest
Feb 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public static void main(String[] args) throws IOException {
  2. BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  3. System.out.println("Choose your password:");
  4. System.out.println("A. Thepasskey");
  5. System.out.println("B. 12345");
  6. System.out.println("C. 54321");
  7. String line = br.readLine();
  8. switch (line) {
  9. case "A"://if one type A as choice
  10. System.out.println("Thepasskey");
  11. break;
  12. case "B":
  13. System.out.println("12345");
  14. break;
  15. case "C":
  16. System.out.println("54321");
  17. break;
  18. default:
  19. System.out.println("error! Check your data");
  20. break;
  21. }
  22. }
Add Comment
Please, Sign In to add comment