I have three classes and I have a circular reference between them.
class A
{
public A()
{
B obj = new B();
}
}
class B
{
public B()
{
C obj = new C();
}
}
class C
{
public C()
{
A obj = new A();
}
}
When I create an object of A
, it's throwing an exception.
How I can create classes instances circularly referencing each other?