Hi all,
I'm just learning C# and completed a book exercise. They had a different answer and I'm not sure the difference between the two.
The way I did a method was like this:
public int ShiftsLeft {
return shiftsToWork - shiftsWorked;
}
However, when I looked at the book they had written:
public int ShiftsLeft {
get {
return shiftsToWork - shiftsWorked;
}
}
Can someone tell me the difference between the two (if there is one) please as it confused me as to why they had done it like that.
Many thanks for any light you can shed on this
John