class CA { } class CB : CA { } class Program { static void Main() { CA a = new CB(); //Is it valid or not? } }

 Posted by deccansoft on 9/20/2010 | Category: C# Interview questions | Views: 899

A reference variable of type parent can refer to an object of child
class because all the members which the reference variable can access
exist in memory when the object is of child class.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response