Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Base class of struct construct in C#

Tags:

People also ask

What is base class constructor?

When objects are constructed, it is always first construct base class subobject, therefore, base class constructor is called first, then call derived class constructors. The reason is that derived class objects contain subobjects inherited from base class.

How do you construct a struct constructor?

A structure called Struct allows us to create a group of variables consisting of mixed data types into a single unit. In the same way, a constructor is a special method, which is automatically called when an object is declared for the class, in an object-oriented programming language.

Does struct have constructor?

Constructor creation in structure: Structures in C cannot have a constructor inside a structure but Structures in C++ can have Constructor creation.

Does a struct need a constructor?

Technically, a struct is like a class , so technically a struct would naturally benefit from having constructors and methods, like a class does. But this is only “technically” speaking.


http://msdn.microsoft.com/en-us/library/ah19swz4(v=VS.71).aspx

As per the above link….. “Structs, however, inherit from the base class Object……”

As per the below link http://msdn.microsoft.com/en-us/library/system.valuetype.aspx Struct is implemented after ValueType in the hierarchy.

“struct” is derived from which class? Or compiler treats “struct” reserve word to make any declaration using “struct” as value type? Missing the small thread in overall understanding. Thank you for your help. Smith