Suppose I have a class that represents rectangles, such that it contains the stored properties 'length' and 'width', and I wish to find the area ... it seems to me that I can define it either as a dependent property (and use the get method to get the area), or as a function (which will return the area).
What is the difference between these two alternatives? After all, to calculate the area for a rectangle object (called rect, say), we would use the same syntax, namely: rect.area
Thanks in advance for your help :-)
No products are associated with this question.
0 Comments