Main.java 639B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner;
  5. public class Main {
  6. public static void main(String[] args ){
  7. /*intialize scanner*/
  8. Scanner scanner = new Scanner(System.in);
  9. System.out.print("What is your name?");
  10. String name = scanner.nextLine();
  11. if (name.equals("Alice")) {
  12. System.out.println("Hey Alice ");
  13. } else if (name.equals("Bob")) {
  14. System.out.println("Hello Bob!");
  15. } else { System.out.println("Unexpected User");
  16. }
  17. }
  18. }