
11 Types
11.1 Value types
11.1.1 Default constructors
Paragraph 11 All value types implicitly declare a public parameterless instance constructor called the default constructor.
Paragraph 21 The default constructor returns a zero-initialized instance known as the default value for the value type:
class A
{
void F() {
int i = 0;
int j = new int();
}
}
Paragraph 41 Because every value type implicitly has a public parameterless instance constructor, it is not possible for a struct type to contain an explicit declaration of a parameterless constructor. 2 A struct type is however permitted to declare parameterized instance constructors (§18.3.8).
| |
| Jagger Software Ltd | |
| Company # 4070126 | |
| VAT # 762 5213 42 |