
How do you perform constructor overloading in C# (C Sharp)?C# permits
constructors of a class to be overloaded. Here is an example demonstrating
it: Output
of this code will be: obj1 members:10,20 In this example,
the constructor of sampleClass is overloaded to accept no arguments, one
argument and two arguments respectively. While creating an instance of
sampleClass, appropriate constructor will be invoked based on the arguments
passed.
_______________________________________________________________________
FREE
Subscription
Subscribe
to our mailing list and receive new articles Note
: We never rent, trade, or sell my email lists to Visit
.NET Programming Tutorial Homepage ______________________________________________________ |