Skip to content
Advertisement

Tag: circular-dependency

Circular dependency in Java constructors

I have the following classes. and As can be clearly seen, there is a circular dependency between the classes. if I try to run class A, I eventually get a StackOverflowError. If a dependency graph is created, where nodes are classes, then this dependency can be easily identified (at least for graphs with few nodes). Then why does the JVM

Advertisement