Java final static declarations in method local classes
When declaring a local inner class inside a method, why is it legal to include final static Strings or ints but not legal to include other objects? For instance: class Outer { void aMethod() { class Inner { final static String name = "compiles"; final static int ctr = 10; // compiles final static Integer intThree = Integer.valueOf(3); // does not compile! final static obj objConst = new Object(); // does not compile! } Inner inner = new Inner(); } } When I compile this, I get the following: InnerExample.java:6: inner classes cannot have static declarations final static Integer outer = Integer