Objects and Classes - Finding Objects and Classes - Referring to a Member Feature
3 important questions on Objects and Classes - Finding Objects and Classes - Referring to a Member Feature
Sometimes, if there are many elements with same named attribute, it becomes difficult to ...?
This could be in speech or in writing a constraint on the value.
- If we want to refer to the year attribute on Book, we would say .....?
- To refer to the year attribute on the Video class, we would say .....?
- If we want to refer to the slot on a book instance, we would use the name of the object, for example, ....? or ....?
- If we want to refer to the year attribute on Book, we would say “Book.year.”
- To refer to the year attribute on the Video class, we would say “Video.year.”
- If we want to refer to the slot on a book instance, we would use the name of the object, for example, “myBook.year” or “myVideo.year.”
If we wanted to refer to the operation, borrow(), that might appear on both the Book and Video class.
We would refer to the operation as ...... ? and .....?
If we wanted to invoke the borrow operation on the myBook instance or on the myVideo instance, we would, in a similar manner, use .....? and .....?
If we wanted to refer to the operation, borrow(), that might appear on both the Book and Video class.
We would refer to the operation as “Book.borrow()” and “Video.borrow().”
If we wanted to invoke the borrow operation on the myBook instance or on the myVideo instance, we would, in a similar manner, use myBook.borrow() and myVideo.borrow().
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding