What is the difference between == operator and equals () method of object class in Java?

Difference between == operator and equals()? The main difference between the == operator and equals() method is, == always checks whether two objects are pointing to the same memory locations or not, on the other hand, equals() compares where values of two objects are similar or not .

Sizin İçin Seçtik  What is a void function example?

Leave a Reply

Your email address will not be published. Required fields are marked *