T
Tim Sprout
Why is it considerd best practice to use Properties rather than Get and Set
accessor methods?
-Tim Sprout
accessor methods?
-Tim Sprout
Tim Sprout said:Why is it considerd best practice to use Properties rather than Get and Set
accessor methods?
Set
accessor methods?
Why is it considerd best practice to use Properties rather than Get and Set
accessor methods?
-Tim Sprout
Dan Reber said:This may be a stupid question but am I using (see below) Properties or
Accessor methods? If am using Accessor methods, how do I convert the below
to Properties?
Jon Skeet said:That's a property. It generates accessor methods behind the scenes, but
it's a property. If you wrote "plain" accessor methods, it would be
something like:
public int GetObjectID()
{
return objectID;
}
public void SetObjectID(int value)
{
objectID = value;
}
The generated accessors have an extra _ in the name, as well as more
metadata.
accessor methods?
-Tim Sprout
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.