When comparing two strings, I was taught that we shouldn\'t use the logical operator (==). We should use String.equals(String) for the comparison. However, I see that the fo
The == operator is used to check if both are references to the same String object while .equals compares the values.
==
.equals