4
Answers

Can a property be so simple? is this correct?

Ask a question
John  Burns

John Burns

13y
7.6k
1

im now learning how to use properties in C# Windows Form.
one thing that strikes me is there the below example is a property BUT there is no mention of the word property when declaring it?
is it really this simple? seems to simple to be true, i expected a bit more to properties as ive seen with other languages.
 
public string Name
    {
        get
        {
           return myName;
        }
        set
        {
           myName = value;
        }
    }


Answers (4)