Javatpoint Logo
Javatpoint Logo

C# Expression bodied getters and setters

C# expression body is a single line expression statement. It is used to provide single life definition to the method, constructor or property. We can use it to provide definition for the getter and setter.

In the following example, we are providing expression body for the getter and setters.

C# Expression bodied getters and setters Example

Output:

Peter

Next TopicC# Async Main





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA