Practicing and exploring
Test your knowledge and understanding by answering some questions, get some hands-on practice, and explore this chapter's topics with deeper research.
Exercise 6.1 - test your knowledge
Answer the following questions:
- What are the four access modifiers and what do they do?
- What is the difference between the
static
,const
, andreadonly
keywords? - How many parameters can a method have?
- What does a constructor do?
- Why do you need to apply the
[Flags]
attribute to anenum
keyword when you want to store combined values? - Why is the
partial
keyword useful?
Exercise 6.2 - practice writing mathematical methods
Create a console application named Ch06_Exercise02
and add three static methods to the Program
class to perform the following tasks: ...
Get C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.