Snippet 1
int str1.compareTo(String str2)
Snippet 2
if (aName.equals(anotherName))
{
System.out.println(aName + " equals " + anotherName);
}
else
{
System.out.println(aName + " does not equal " +anotherName );
}
Copyright © Code Fetcher 2020