See the following snap code
class Class1
{
Class2 o = new Class2();
}
class Class2
{
Class1 o = new Class1();
}
Answer:
Both the classes are creating objects of each other due which the object will pile up in the memory and lead to "StackOverFlowException".
See the rightside video on regular expressions along with some practical demonstrations as follows: -
YOU ARE READING
