Created
September 11, 2018 19:11
-
-
Save nhojpatrick/f5c3f7c3e1234eaa36362fb40ac2560f to your computer and use it in GitHub Desktop.
A Bad Hello World example using static and public references of objects.
This file contains 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
public class Parent { | |
public static final Level1 l1 = new Level1(); | |
public static class Level1 { | |
public final Level2 l2 = new Level2(); | |
} | |
public static class Level2 { | |
public final String helloWorld = "Hello World"; | |
} | |
public static void main(final String[] args) { | |
System.out.println(Parent.l1.l2.helloWorld); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment