Question: what is the difference between == vs equals() in java?
Answer: In general both equals() and “==” operator in Java are used to compare objects to check equality but here are some of the differences between the two: ... In simple words, == checks if both objects point to the same memory location whereas . equals() evaluates to the comparison of values in the objects.