Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Simple Conditions
- */
- import java.util.Scanner;
- public class _11b_EqualWords
- {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- // Input two strings and set them lower case
- String word1 = scan.nextLine().toLowerCase();
- String word2 = scan.nextLine().toLowerCase();
- // Using ternary operator (?:) to print the result
- // result = Condition ? Statement1 : Statement2;
- System.out.println((word1.equals(word2)) ? "yes" : "no");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment