0
What is property?
2 Answers
+ 2
Think of it as a way for you to define and/or query some aspects of an object, for example, a car, may have the following properties:
* Colour (red, green, blue etc.)
* Engine capacity (in CC)
* Power source (Fuel, electric)
* Manufacturer (Mitsubishi, Toyota etc.)
And some other properties you can think of to distinguish a certain car from others.
In programming, properties are used to encapsulate values, so that access and modification to these values can be validated and organized, properties are also well known as getters and/or setters.
Properties can be designed as read-only, write-only, or read and write, depending on the design. Read-only properties only returns the property value, write-only properties only allows to change the value, read write means we can do both.
P.S. Next time please indicate a specific language in the "Relevant tags" part of your question, it helps others to narrow your question scope : )
+ 1
thanks