I have the following problem... I need to compare two string and output the first one if they are not equal. Something like the code below, but printing the first string instead. How can I do it?
String myString1 = new String("abc123");
String myString2 = new String("abc");
if(myString1.equals(myString2))
{
System.out.println("The two strings are equal");
}
else
{
System.out.println("The two strings are not equal");
}