Calling Constructor from another Constructor:
- public class mySampleClass
- {
- public mySampleClass(): this(10)
- {
- // No parameter constructor method.// First Constructor
- }
- public mySampleClass(int Age)
- {
- // Constructor with one parameter.// Second Constructor}
- }
- }
No comments:
Post a Comment