Generate Overrides for equals(), hashCode() and toString()

We can generate the code to override the equals and hashCode methods.

You can use ⌘N (macOS) / Alt+Insert (Windows/Linux) for the Generate menu and then select equals() and hashCode(). You can also use the same shortcut again and select toString() to override that method as well.

Interested in JVM Development?

call to action image

IntelliJ IDEA can generate your getters and setters too!

Learn More


Related Resources

Create an Editor Fold
Create an Editor Fold
Create an editor fold to hide parts of your class which can make it more readable.
Surround With
Surround With
Surround your code with common programming constructs.
View supertype and subtype hierarchy
View supertype and subtype hierarchy
You can view supertypes and subtypes in the hierarchy quickly with your keyboard shortcuts.