WIP: default method reloading

This commit is contained in:
Andy Clement
2016-01-18 22:56:27 -08:00
parent f161db7d98
commit bfb55e4c0e
8 changed files with 122 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
package basic;
public class DefaultMethodsC1A implements DefaultMethodsI1A {
public static int run() {
DefaultMethodsC1A instance = new DefaultMethodsC1A();
instance.test();
return 42;
}
}

View File

@@ -0,0 +1,9 @@
package basic;
public class DefaultMethodsC2A implements DefaultMethodsI2A {
public static int run() {
DefaultMethodsC2A instance = new DefaultMethodsC2A();
return 42;
}
}

View File

@@ -0,0 +1,10 @@
package basic;
public class DefaultMethodsC2A2 implements DefaultMethodsI2A2 {
public static int run() {
DefaultMethodsC2A2 instance = new DefaultMethodsC2A2();
instance.test();
return 43;
}
}

View File

@@ -0,0 +1,5 @@
package basic;
public interface DefaultMethodsI1A {
public default void test() {}
}

View File

@@ -0,0 +1,5 @@
package basic;
public interface DefaultMethodsI1A2 {
public default void test() {System.out.println("FOO");}
}

View File

@@ -0,0 +1,4 @@
package basic;
public interface DefaultMethodsI2A {
}

View File

@@ -0,0 +1,7 @@
package basic;
public interface DefaultMethodsI2A2 {
public default void test() {
System.out.println("FOO");
}
}