Try this syntax too:
public MyClass( int x ) : this( )
{
abc = x;
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Is there any way to do that? Or just copy all the code in to parameter constructor?
Try this syntax too:
public MyClass( int x ) : this( )
{
abc = x;
}
Create a method in your class that both constructors can call.
Hi @兰树豪,
MyClass is a Class name. so you should use it as a class.
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.