In Java OOPS course, whenever equals method() is overridden using IntelliJ, this line
(if (o == null || getClass() != o.getClass()) return false;) is generated. I would like to why they are comparing getClass() values using != instead of equals method, because whenever String is compared using == or !=, it might give an incorrect result right. Please explain this @programmingwithmosh @SAM !!
Note: the return type of getClass() is runtime class of the object.