3 ms·
It's better to not confuse data with behavior. Move the polymorphism to the data type, and model the behavior with an interface. Now you don't have to validate
by tadfisher 3y ago
It's better to not confuse data with behavior. Move the polymorphism to the data type, and model the behavior with an interface. Now you don't have to validate arguments to super() because there isn't one.
- iraqmtpizza 3y agoYou can't have default methods for equals, hashCode, and toString in Java interfaces. And even if you could, without access to the data they wouldn't be of much use.