Properties (Exercise) – Learn C#

Properties (Exercise) – Learn C#

Properties are an elegant way to handle extra logic for getting or setting a field. As opposed to Java’s getter and setter methods, C# has properties which can help you in C# programming.

This is an exercise for this YouTube video.

Happy learning and good luck!


Can a property have only a setter?
Can a property have only a getter?
Can a property have expression-bodied accessors (get/set)?


Assignment: Create a write-only property.



Click to see the answer



Leave a Comment