Main.java 581B

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