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



About the author 

Matt Rešetár

Matt is an app developer with a knack for teaching others. Working as a Flutter freelancer and most importantly developer educator, he doesn't have a lot of free time 😅 Yet he still manages to squeeze in tough workouts 💪

You may also like

Flutter Bloc & Cubit Tutorial

Flutter Custom & Staggered Page Transition Animation Tutorial

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}