PrepZone Logo
PrepZone
Back to Java

Java · Medium

Can a Java Record have custom methods, implement interfaces, and be generic? Explain with examples.

JavaJava 17+

Answer preview

Yes — records can have custom methods, static methods, static fields, instance fields (static only), and even implement interfaces with custom behavior. They are not limited to auto-generated accessors.…