this is rather a theoretical question but maybe you know the specification that deep that will let you answer... Why this code yields false in terms of if the anonymous class is final? In practice the class can be considered final (there is no way to extend it without bytecode manipulation):
public class Modifiers
{
public static void main(final String[] args) throws ClassNotFoundException
{
new Modifiers().go();
}
public void go() throws ClassNotFoundException
{
final Runnable r = new Runnable()
{
@Override
public void run()
{
System.out.println("Inside runnable");
}
};
r.run();
System.out.println(Modifier.isFinal(getClass().getClassLoader().loadClass(Modifiers.class.getName() + "$1").getModifiers()));
}
}