How can I initialize interdependent final references?
问题 I have a class and a factory function that creates new anonymous class objects extending that class. However, the anonymous class objects all have a method in which there are references to other objects. In my full program, I need this to create and combine parsers, but I've stripped down the code here. class Base{ public Base run(){ return null; } static Base factory(final Base n){ return new Base(){ public Base run(){ return n; } }; } } public class CircularReferences{ public static void