Can somone please tell me what does the syntax below means?
public ScopeCanvas(Context context, IAttributeSet attrs) : base(context, attrs)
{
}
I mean what is method(argument) : base(argument) {} ??
P.S This is a constructor of a class.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
:basesyntax is a way for a derived type to chain to a constructor on the base class which accepts the specified argument. If omitted the compiler will silently attempt to bind to a base class constructor which accepts 0 arguments.There is also the
:thissyntax which allows chaining to constructors in the same type with a specified argument list