Xpode.com        Click here to Print this article.

.NET interview questions: - Show output for the following code of two classes?

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". Below is the error image which is displayed once the memory is overused.

See the following video on regular expressions along with some practical demonstrations as follows: -

Visit to get more stuff on .NET interview questions

Regards,

Also visit for more author’s other blogs on .NET interview questions



http://
http://

Contributed by:
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site http://www.questpond.com for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers

Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=522

Click here to go on website