+ 2

Whats the difference between fields and properties?

Hi all, As title says, whats the difference between fields and properties? Are properties the getters and setters of a variable? And is a field the same as a variable? Thanks in advance!

25th Nov 2016, 11:00 AM
Sjoerd B
Sjoerd B - avatar
2 Answers
+ 3
You're right: fields are variables, and properties are the getters and setters of a variable (or more specifically, a data member accessed by the means of an accessor).
25th Nov 2016, 11:46 AM
Samuel Neo
Samuel Neo - avatar
+ 1
thank you!
26th Nov 2016, 3:19 PM
Sjoerd B
Sjoerd B - avatar