Click here to Skip to main content
14,265,979 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
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.
The_Unknown_Member 5-Jun-17 14:19pm

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

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