
Can you call a constructor from another constructor of the Class in .NET?Yes. You
can call a constructor from another constructor using this keyword. class sampleClass
{ Output of
this code will be: Member1:10
Member2: Good Day! In this example,
you created an instance of sampleClass by calling the two argument constructor.
In the two argument constructor, you call the one argument constructor
in which value for member1 is set. After executing the call, the two argument
constructor assigns value to member2.
_______________________________________________________________________
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 ______________________________________________________ |