In this article we will cover following points
1. Struct definition
2. Struct members
3. Inheritance in struct
4. Struct instantiation, member initialization & accessibility
A struct type is a value type that is typically used to encapsulate small groups of related
variables, such as the coordinates of a rectangle or the characteristics of an item in an
The struct type is suitable for representing lightweight objects such as Point, Rectangle,
Struct is declared using the keyword struct.
//members (fields, methods etc.)
Structs can contain
9. nested types
if several such members are required, you should consider making your type a class
Inheritance in struct
1. A struct can not inherit from another struct or class.
2. A struct can not be base of a class.
3. Struct can implement interfaces, and it does that exactly as classes do..
Struct instantiation, member initialization & accessibility
1. It is an error to define a default (parameterless) constructor for a struct.
2. You can initialize struct members only by using a parameterized constructor.
3. structs can be instantiated without using the new operator.