Main.java 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner; //get access to the library
  5. public class Main {
  6. public static void main(String[] args ){
  7. // SAVES INPUT
  8. String name1;
  9. String name2;
  10. //get input
  11. Scanner input = new Scanner(System.in);
  12. System.out.println("Enter your name: ");
  13. name1 = input.nextLine(); //assign first input
  14. System.out.println("Enter other name: ");
  15. name2 = input.nextLine();// assign second input
  16. //make the names lowerCase
  17. name1.toLowerCase();
  18. name2.toLowerCase();
  19. String nameSaver1 = name1;
  20. String nameSaver2 = name2;
  21. if((name1.equals(nameSaver1)||name1.equals(nameSaver2))&&((name2.equals(nameSaver1))||(name2.equals(nameSaver2))))
  22. {
  23. System.out.println("Hello!" + name1 +" "+ name2);
  24. }
  25. else
  26. {
  27. System.out.println("I do not know you guys!");
  28. System.out.println("false ");
  29. }
  30. }
  31. }