What methods should go into a java.util.Objects class in JDK 7? (original) (raw)
Paul Benedict pbenedict at apache.org
Sat Oct 10 01:55:04 UTC 2009
- Previous message: What methods should go into a java.util.Objects class in JDK 7?
- Next message: What methods should go into a java.util.Objects class in JDK 7?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Joe,
Classes with only private constructors, like j.u.Objects, are effectively final. Adding final is harmless but unnecessary in these cases.
Understood, but the keyword (pun) here is "effectively". Why let a developer wait until runtime to find out his code will fail? At least by marking the class as final, anybody who wishes to subclass it will receive a compiler error. Rain on the parade early :-)
Anyway, thanks for considering it in the next round.
Paul
- Previous message: What methods should go into a java.util.Objects class in JDK 7?
- Next message: What methods should go into a java.util.Objects class in JDK 7?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]