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
William Thompson
1.6k
155
299.7k
Is { get; set; } useful?
Jun 29 2018 2:56 PM
from time to time, I see some sample code that is handed to me that has a code snippet that looks like this:
public
string
Name {
get
;
set
; }
Does this actually do anything? Does it really make it so that one can set and get the "Name" string variable?
I have always thought that what is required is something like this:
private
string
name;
public
string
Name
{
get
{
return
this
.name;
}
set
{
this
.name = value;
}
}
Am I correct?
Please advise.
Reply
Answers (
4
)
Code for Add and/or Append a row in GridView C#
How to simulate processor in C#