Skip to content

Instantly share code, notes, and snippets.

@weezqyd
Created January 13, 2018 19:40
Show Gist options
  • Save weezqyd/04987ff2ba5c938dc00131b113e035d8 to your computer and use it in GitHub Desktop.
Save weezqyd/04987ff2ba5c938dc00131b113e035d8 to your computer and use it in GitHub Desktop.
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");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment