What is the difference between equals () method and == operator with example?

Second difference between equals and == operator is that == is used to check a reference or memory address of the objects whether they point to the same location or not, and the equals() method is used to compare the contents of the object e.g. in case of comparing String its characters, in case of Integer it’s their …7 Kas 2021

Sizin İçin Seçtik  Can we create object in C++ without new?

Leave a Reply

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