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:

  1. What are the four access modifiers and what do they do?
  2. What is the difference between the static, const, and readonly keywords?
  3. How many parameters can a method have?
  4. What does a constructor do?
  5. Why do you need to apply the [Flags] attribute to an enum keyword when you want to store combined values?
  6. What is a delegate?
  7. What is an event?
  8. 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 ...

Get C# 6 and .NET Core 1.0: Modern Cross-Platform Development 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.