In this video we will see how to compare two strings and concatenate strings in java.
Comparing two Strings:
Strings are compared with equals method.
Str1.equals(Str2);
== is used to compare others.
For example, integer values are compared with == method.
If you use == to compare strings, it compares the reference points but not the actual values.
Concatenating two strings:
For concatenating two strings we use + operator.