Skip to content

Instantly share code, notes, and snippets.

@mirsahib
Last active February 18, 2017 12:15
Show Gist options
  • Save mirsahib/503b2a40f42a0978a3663d7f7294f299 to your computer and use it in GitHub Desktop.
Save mirsahib/503b2a40f42a0978a3663d7f7294f299 to your computer and use it in GitHub Desktop.
public class TestDocument {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String a = input.nextLine();
String b = "a-";
//when the user input is a- case 1 return false
//case 1
System.out.println(a=="a-"||a=="A-");
//case 2
System.out.println(b=="a-"||b=="A-");
//System.out.println(a.length());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment