example of variable:
private int experience
example of property:
public int Experience {
get{
return experience;
}
set{
experience = value;
}
}
Reason for using the property:
- use for access date outside the class
- can set read only or write only
- can implement functions within set and get