Java Interview Question And Answer. Java interview question and answer related to core java. . .
- How do we compare two String objects?
We use equal() method of String class to compare two String objects. We
must not use '==' operator to compare the string values of two String
objects as its check the reference only- whether both are pointig to the
same object or not.
System.out.println("Both are equals");
Please provide your feedback here