Can anyone explain what the ":" stands for in code. I understood the code but dont know the logic/condition behind this ":" operator.
public Constructor() : this("No names", string.Empty)
{
}
Can anyone explain what the ":" stands for in code. I understood the code but dont know the logic/condition behind this ":" operator.
public Constructor() : this("No names", string.Empty)
{
}
In your case, you have a class with multiple constructors, so the
class Constructor()
has a default(no args) constructor and a constructor wit 2 strings as argument.
If some one calls the default constructor, then the class will internally call the constructor with 2 strings overloading it.
that is the explanation of that code