2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Momerath
0
public String Name {get; set;}

This defines a public property called Name. The compiler will generate the backing field and all the code needed for you. You can also include access modifiers:

public String Name {get; private set;}

In this case the set is private, so can only be called from within the object.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.