Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Created October 25, 2012 03:47
Show Gist options
  • Select an option

  • Save baroquebobcat/3950315 to your computer and use it in GitHub Desktop.

Select an option

Save baroquebobcat/3950315 to your computer and use it in GitHub Desktop.
Playing w/ Java constants
// complains that you can't have the inner class w/ same name
public class Blargh {
public static class Blargh{}
}
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