Why are all anonymous classes implicitly final? <p>According to the JLS:</p> <blockquote> <p>15.9.5 Anonymous Class Declarations An anonymous class declaration is automatically derived from a class instance creation expression by the compiler.</p> <p>An anonymous class is never abstract (§8.1.1.1). An anonymous class is always an inner class (§8.1.3); it is never static (§8.1.1, §8.5.2). <strong>An anonymous class is always implicitly final (§8.1.1.2)</strong>.</p> </blockquote> <p>This seems like it was a specific design decision, so chances are it has some history.</p> <p>If I choose to have a class like this:</p> <pre><code>SomeType foo = new SomeType() { @Override void foo() { super.foo(); System.out.println("Hello, world!"); } }; </code></pre> <p>Why am I not allowed to subclass it again if I so choose?</p> <pre><code>SomeType foo = new SomeType() { @Override void foo() { super.foo(); System.out.println("Hello, world!"); } } { @Override void foo() { System.out.println("Hahaha, no super foo for you!"); } }; </code></pre> <p>I'm not saying I necessarily want to, or can even think of a reason why I would. But I am curious why this is the case.</p>