Javatpoint Logo
Javatpoint Logo

C# Auto-Implemented Properties

C# 3.0 includes a concept of auto-implemented properties that requires no code inside get and set methods of the class properties. It makes code concise and readable.

The C# compiler creates private fields correspond to the properties and are accessible using the get and set methods.

Let's see an example of Auto-Implemented Properties.


C# Auto-Implemented Properties Example

Output:

101
Rahul Kumar
rahul@example.com

Next TopicC# Dynamic Binding




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA