C# Get/Set Syntax Usage
- by RoR
These are declarations for a Person class.
protected int ID { get; set; }
protected string Title { get; set; }
protected string Description { get; set; }
protected TimeSpan jobLength { get; set; }
How do I go about using the get/set? In main, I instantiate a
Person Tom = new Person();
How does Tom.set/get??
I am use to doing C++ style where you just write out the int getAge() and void setAge() functions. But in C# there are shortcuts handling get and set?