Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Explaining 'RECT r' in a short way
If I had to explain 'RECT r' in short way, I would do it like this:

Select All      Help
Imagine an object: a rectangle.
A rectangle has attributes for example: 4 sides and 4 corner points!
In this code you see:


'r' now inherits the attributes from 'RECT'. In essence we created an object 'r' which has 4 attributes.
The moment I created object 'r' of the type RECT, 'r' gained the attributes of RECT.
This means the moment you type 'r' and then immediately a dot, the attributes belonging to 'RECT' are immediately accessible.
You could also say 'r' inherited the attributes from 'RECT'.

Is this an acceptable explanation? Or am I completely off?
Acceptable, but word "inherits" in programming is used for a different thing. I would replace "'r' now inherits the attributes from 'RECT'." with "r is an instance of objects described by the RECT type". Like "r0n is an instance of objects described by the HUMAN type".
Ok! Perfect!
Thank you! I really appreciate this!

Forum Jump:

Users browsing this thread: 1 Guest(s)