Created
October 25, 2012 03:47
-
-
Save baroquebobcat/3950315 to your computer and use it in GitHub Desktop.
Playing w/ Java constants
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
| // complains that you can't have the inner class w/ same name | |
| public class Blargh { | |
| public static class Blargh{} | |
| } |
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
| public class NotBlargh { | |
| public static class Blargh {} | |
| public static final String Blargh = ""; | |
| public static void main(String[] blarghs) { | |
| System.out.println(Blargh.class.getName()); // Blargh the subclass | |
| System.out.println(Blargh.getClass()); // Blargh the String | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment