I have some two Strings as below:
"yes", "no".
Now, I would like to compare these Strings in two ways:
Directly:
Example:"yes".equals("no")By assigning the strings to some variable: Example:
String string1 = "yes"; String string2 ="no"; string1.equals(string2);
In these two cases, is there any memory or performance difference?