I understand that if a section overrides a default method, you can use the default method in the following method IFoo {Default Zero Bar () {}} class MyClass implements iFoo {void bar ()) {} zero IOOBAR () {IFoo.super.bar (); }} But about the case where the interface overrides a default method? Is parental method available in any way? IFoo interface {default zeros bar () {}} Extends the interface ISUBF IFoo {// IFoo.bar is available anywhere? The default zero time {}} class uses MyClass ISubFoo {// IFoo.bar is available anywhere elsewhere? Public Stable Zero Main (string [] Args) {MyClass MC = New MyClass (); Mc.bar (); // call ISubFoo.bar}} The use of the word java for the default method is similar to classes, otherwise it is confusing / confusing subinterface default methods "heirs", and "overwrite them" " can do. So it seems that IFoo.bar should be accessible anywhere.
You can go up one level, so IFoo.bar () In the ISUBFu, IFoo.super.bar () . interface is available with IFoo {default zero time ()} {}} Interface ISUBF Expands IFoo {// IFoo.bar is available anywhere? // Yes this is the default zero time {IFoo.super.bar ()}} Class MyClass uses ISUBFU {// IFoo.bar is available anywhere? // This public static is not zero main (string [] args) {MyClass MC = New MyClass (); Mc.bar (); // call ISubFoo.bar}}
Comments
Post a Comment