TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deenbandhu Singh
NA
8
0
Difference between a property and variable
Sep 29 2009 6:40 PM
Can anyone explain me difference between a property and variable. I found them more or less same like both are used for storing and retrieving values.
I saw a code where player info has to be strored and for that some properties were declared inside a class. Property names are Name, PlayerNo, Age.
code:
private string name;
public string Name
{
get
{return name;}
set
{name =value;}
}
..................
..................
But we can easily do this task using variables.
So is there any advantage of using properties instead of variables.
Reply
Answers (
11
)
TransparentProxies and ArrayLists
How make window application trial version?