-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Open
Labels
Description
Type of issue
Typo
Description
In the Static constructors section, the first example is
public class Adult : Person
{
private static int minimumAge;
public Adult(string lastName, string firstName) : base(lastName, firstName)
{ }
static Adult() => minimumAge = 18;
// Remaining implementation of Adult class.
}However based on the context, I think the first example should be the following code since the second example employs the expression body definition.
public class Adult : Person
{
private static int minimumAge;
public Adult(string lastName, string firstName) : base(lastName, firstName)
{ }
static Adult()
{
minimumAge = 18; // Here is the change I propose.
}
// Remaining implementation of Adult class.
}What do you think of it?
Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/constructors
Content source URL
Document Version Independent Id
7f3cd611-9d80-4523-6ba5-17e1e9ab5c67
Platform Id
b9778cfa-3239-7384-359d-bf5c8714b98b
Article author
Metadata
- ID: 754eaea9-3482-4a69-5b65-ebe4a5065597
- PlatformId: b9778cfa-3239-7384-359d-bf5c8714b98b
- Service: dotnet-csharp
- Sub-service: fundamentals