Last active
April 29, 2020 06:30
-
-
Save wilkinsona/8c4b556d88681e18d3d80d39db6ad786 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.List; | |
public class FunWithStaticInitialization { | |
public static void main(String[] args) { | |
new SimpleThing(); | |
} | |
interface Thing { | |
Thing DEFAULT = new SimpleThing(); | |
default void method() { | |
} | |
} | |
static class SimpleThing implements Thing { | |
private static List<String> items = Arrays.asList("alpha", "bravo"); | |
SimpleThing() { | |
System.out.println(items.size()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment