How the equals operator differs from the equals equals operator?

1 answer

Answer

1248413

2026-07-30 12:40

+ Follow

obj2 = true only if both has same memory location.

on the other hand equals() is a method defined in Object class and has overridden in many classes including String, Integer and provides logical equality e.g. two strings are equal by equals() method if there content are same.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.