Struct can be inherited or not?

 Posted by Rajni.Shekhar on 4/11/2012 | Category: C# Interview questions | Views: 1576 | Points: 40
Answer:

No, Struct can not be inherited because it is sealed implicitly.

Example:

public struct struct1

{
}

public class class1 : struct1 //Error : 'class1': cannot derive from sealed type 'struct1'
{
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Akiii on: 4/12/2012 | Points: 10
Good question....


Thanks and Regards
Akiii

Login to post response