borkins

11b. Equal Words

Mar 23rd, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. /*
  2.  * Simple Conditions
  3.  */
  4. import java.util.Scanner;
  5.  
  6. public class _11b_EqualWords
  7. {
  8.     public static void main(String[] args)
  9.     {
  10.         Scanner scan = new Scanner(System.in);
  11.        
  12.         // Input two strings and set them lower case
  13.         String word1 = scan.nextLine().toLowerCase();
  14.         String word2 = scan.nextLine().toLowerCase();
  15.        
  16.         // Using ternary operator (?:) to print the result
  17.         // result = Condition ? Statement1 : Statement2;
  18.         System.out.println((word1.equals(word2)) ? "yes" : "no");
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment