Practicing and exploring
Test your knowledge and understanding by answering some questions, getting some hands-on practice, and exploring this chapter's topics with deeper research.
Exercise 5.1 – Test your knowledge
Answer the following questions:
- What are the seven access modifier keywords and combinations of keywords, and what do they do?
- What is the difference between the
static
,const
, andreadonly
keywords when applied to a type member? - What does a constructor do?
- Why should you apply the
[Flags]
attribute to anenum
type when you want to store combined values? - Why is the
partial
keyword useful? - What is a tuple?
- What does the
record
keyword do? - What does overloading mean?
- What is the difference between the following two statements? (Do not just say a ">" character!)
public List<Person> Children = new();
public List<Person> Children => new();
- How do you make a method parameter optional?