Timeline for Why not default constructors in Java 8?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 5, 2016 at 10:32 | vote | accept | Supun Wijerathne | ||
| Sep 5, 2016 at 10:32 | |||||
| Jun 30, 2016 at 15:01 | comment | added | Holger | @hyde: that’s a nonsensical scenario, as there is nothing useful which init() can do. The object created via new MyFace(){} doesn’t contain any state that an init() method could modify. | |
| Jun 30, 2016 at 11:40 | comment | added | hyde | Having interface default constructor would avoid hypothetical code like MyFace obj = new MyFace(){}; obj.init();´, so a bit more than just ´{}´, especially if calling init would be mandatory for implementation. | |
| Jun 30, 2016 at 5:49 | comment | added | Michael Markidis | I'm not sure if this is really creating an "instance" of the interface. Your really creating an inline implementation. | |
| Jun 30, 2016 at 5:28 | history | answered | Bohemian♦ | CC BY-SA 3.0 |