mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
509 B
29 lines
509 B
using System; |
|
|
|
internal class MemberInitializers |
|
{ |
|
private int instanceField = Compute(1); |
|
|
|
private int InstanceProperty { get; } = Compute(2); |
|
|
|
public MemberInitializers() |
|
{ |
|
Console.WriteLine(instanceField + InstanceProperty); |
|
} |
|
|
|
public MemberInitializers(int value) |
|
{ |
|
Console.WriteLine(instanceField + InstanceProperty + value); |
|
} |
|
|
|
private static int Compute(int value) |
|
{ |
|
return value; |
|
} |
|
|
|
private static void Main() |
|
{ |
|
_ = new MemberInitializers(); |
|
_ = new MemberInitializers(3); |
|
} |
|
}
|
|
|