Question: what is the difference between equals() and method and == operator?
Answer: Main difference between . equals() method and == operator is that one is method and other is operator. ... When we use == operator for s1 and s2 comparison then the result is false as both have different addresses in memory. Using equals, the result is true because its only comparing the values given in s1 and s2.