Skip to content

Constructors

Mario Gutierrez edited this page Jan 7, 2017 · 3 revisions

Chaining

public Card(char rank, char suit) { } // The master constructor.
public Card() : this('2', 'C') { } // Chain to the master constructor.

Static

You can initialize static variables with the static constructor. This is called only once on first instantiation of the class, or on static member access.

static MyClass()
{
  // Initialize some static variable.
}
Clone this wiki locally