C# is language which operates with two kind of types:
value type - type where only one space of memory is allocated. It is related for primitive C# types like: int, char, float, bool etc. as well as
for struct types. If you copy value type to another type new instance of object will be created.
reference type - type related to class objects. When we are declaring such class object, two memory spaces are...
C# - Calling one constructor from another
In order to call one constructor from another constructor in C# programming language you can use below syntax:
class Plane
{
Plane (){}
Plane (int a) : this() {}
Plane (int a, int b) : this(int a) {}
}
In above example constructor Plane (int a) invokes parameterless constructor Plane(). Constructor Plane(int a, int b) invoke two above constructors nested.
...
Powered by Blogger.