-2

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)
{
}
dbc
  • 104,963
  • 20
  • 228
  • 340
Reza Taibur
  • 263
  • 3
  • 10

1 Answers1

2

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

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97