constructor
Code that runs when an object is created, to set it up.
A constructor is a special method named after its type that initializes a new instance; constructors can chain with this(...) and base(...).
Loading interactive…
Examples
public Account(string owner) { Owner = owner; }runs when you writenew Account("Ana").