Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package stringCompare;
- import java.util.Scanner;
- public class stingCompare {
- private static Scanner scanner = new Scanner( System.in );
- /**
- * Application entry point
- */
- public static void main(String args[]) {
- System.out.println("Java String comparison");
- System.out.println("Provide First String");
- // Read first string from the user.
- String input = scanner.nextLine();
- System.out.println("Provide Second String");
- // Read first string from the user.
- String input2 = scanner.nextLine();
- if(input.equalsIgnoreCase(input2)) {
- System.out.println("The two strings are equal");
- } else {
- System.out.println("The provided strings are not equal");
- }
- }
- }
Add Comment
Please, Sign In to add comment