Re: Properties
- From: "Jon Slaughter" <Jon_Slaughter@xxxxxxxxxxx>
- Date: Sun, 8 Oct 2006 18:43:11 -0500
"Joanna Carter [TeamB]" <joanna@xxxxxxxxxxxx> wrote in message
news:%23NDg%23xy6GHA.348@xxxxxxxxxxxxxxxxxxxxxxx
"Jon Slaughter" <Jon_Slaughter@xxxxxxxxxxx> a écrit dans le message de
news:
12iiv3j3ro2b8ea@xxxxxxxxxxxxxxxxxxxxx
| private string name;
| public string Name
| {
| get { return name; }
| set { name = value; }
| }
|
| Why the need to declare the same thing basically twice? If, say there
was
no
| block associated with the variable then its assumed to be a field
instead
of
| a property.
You are not declaring the same thing twice; name is a field, Name is a
property, there is not necessarily a one-to-one relationship. See my other
reply for more options.
Um, I did and you didn't state anything that was useful.
A field isn't a property. So what, I never said they were. The fact is,
AFAIK, one can distinguish a field from a property simply by having a block
after the decleration of the field(i.e., now its a property). If this is not
the case then obviously you can't.
.
- Follow-Ups:
- Re: Properties
- From: Peter Duniho
- Re: Properties
- References:
- Properties
- From: Jon Slaughter
- Re: Properties
- From: Joanna Carter [TeamB]
- Properties
- Prev by Date: Re: Properties
- Next by Date: Re: Get name of instance of object
- Previous by thread: Re: Properties
- Next by thread: Re: Properties
- Index(es):
Relevant Pages
|