Main.java 567B

12345678910111213141516171819202122
  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. }
  8. public void greeting(){
  9. Scanner keyboard = new Scanner(System.in);
  10. System.out.print("what is your name?");
  11. String name = keyboard.nextLine();
  12. if(name.equals("Alice")){
  13. System.out.println("Hello Alice!");
  14. } else if (name.equals("Bob")){
  15. System.out.println("Hello Bob!");
  16. } else {
  17. System.out.println("Hello " + name);
  18. }
  19. }
  20. }