Complete the code to declare an init-only property named Name.
public string Name { get; [1]; }The init accessor allows setting the property only during object initialization.
Complete the code to create a record with an init-only property Age.
public record Person { public int Age { get; [1]; } }Records often use init to make properties immutable after creation.
Fix the error in the property declaration to make it init-only.
public string Title { get; [1]; }Changing set to init makes the property settable only during initialization.
Fill both blanks to define an init-only property with a private getter.
public string Description { [1] get; [2] }The property has a private getter and an init-only setter.
Fill all three blanks to create a record with an init-only property and a constructor.
public record Book [1] { public string Author { get; [2]; } = [3]; }
The record has a parameterless constructor, an init-only property, and a default value.
