Click here to Skip to main content
14,209,666 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi. I have question about the auto-implemented properties in C#. So, when I make an auto-implemented public property in my class but when i make an object (instance) of the class and I set something to the property and then get it how its working when there is no private field ? I think the compiler allocates memory somewhere in the memory and making the property to point to the address of the value ? Is that the answer or I am wrong ?

What I have tried:

Tried to search but with no results. Then I came here to ask my question
Posted
Updated 5-Jun-17 2:09am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You still look for someone ot write you a book about programming?

the compiler creates a private, anonymous backing field that can only be accessed through the property's get and set accessors.
   
Comments
The_Unknown_Member 5-Jun-17 14:19pm
   
Thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190617.3 | Last Updated 5 Jun 2017
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100