All about Java String.
In Java Strings are the objects however they resemble primitives like charS or intS. In that java source, code may be having the String literals and + operator might be used to concatenate the Strings. These features are quite convenient, however similarity present b/w Strings & primitives may cause certain confusions, when comparison is done of the Strings.
Two mechanisms are provided by Java to do the test for equality. Use “==” operator for testing of the primitive values equality.