java
1package hoge; 2 3interface Bar{ 4 void put(String s); 5 default void twice(String s){ 6 put(s + s); 7 } 8} 9 10interface Foo{ 11 void print(String s); 12 default void twice(String s){ 13 print(s); 14 print(s); 15 } 16} 17 18public class MainSystem implements Bar, Foo { 19 @Override 20 public void print(String s) { 21 System.out.println(s); 22 } 23 @Override 24 public void put(String s) { 25 System.out.println(s); 26 } 27 @Override 28 public void twice(String s) { 29 Foo.super.twice(s); 30 } 31 public static void main(String... args) { 32 MainSystem msys = new MainSystem(); 33 msys.twice("hoge"); 34 } 35} 36
この場合なぜFoo.super.twice(s);ではなくFoo.this.twice(s);ではだめなのでしょうか。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/05/03 12:18