DEV Community

Discussion on: Did you ever try to write Java equals() with clean code style?

Collapse
 
rapidnerd profile image
George

Got an example of what you're referring to here?

I tend to only use equals() when comparing strings, when it comes to objects I tend to use == .

Collapse
 
voins profile image
Alexey Voinov

I've posted it on the thread above. It is all about the standard Java equals() that is, for example, generated by IntelliJ IDEA.

I'm not sure, that comparing, that what I have is actually two references to the same instance is enough for any more or less complex piece of software. But that could be an interesting challenge. :) Thanks for the idea.