123456789101112131415161718192021
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner;
  5. public class Main {
  6. // the name user input
  7. public static void main(String[] args ){
  8. Scanner kb = new Scanner(System.in);
  9. System.out.println("Enter a name");
  10. String n = kb.nextLine();
  11. aliceOrBob(n);
  12. }
  13. public static void aliceOrBob(String name)
  14. {
  15. String message = name.equals("Alice") || name.equals("Bob") ? ("Hello " + name)
  16. : ("Try a new name");
  17. System.out.println(message);
  18. }
  19. }