
Untitled
By: a guest on
May 27th, 2012 | syntax:
None | size: 0.50 KB | hits: 21 | expires: Never
Are defaults in JDK 8 a form of multiple inheritance in Java?
public interface SomeInterface() {
void existingInterface();
void newInterface() default SomeClass.defaultImplementation;
}
public interface Attendance {
boolean present() default DefaultAttendance.present;
}
public interface Timeline {
boolean present() default DefaultTimeline.present;
}
public class TimeTravelingStudent implements Attendance, Timeline {
}
// which code gets called?
new TimeTravelingStudent().present();