98-361 · Question #52
You have a class named Truck that inherits from a base class named Vehicle. The Vehicle class includes a protected method named brake (). How should you call the Truck class implementation of the…
The correct answer is C. MyBase. brake(). The MyBase keyword behaves like an object variable referring to the base class of the current instance of a class. MyBase is commonly used to access base class members that are overridden or shadowed in a derived class.
Question
You have a class named Truck that inherits from a base class named Vehicle. The Vehicle class includes a protected method named brake (). How should you call the Truck class implementation of the brake () method?
Options
- AVehicle. brake ();
- BThis. brake ();
- CMyBase. brake();
- DTruck. brake ();
How the community answered
(26 responses)- A4% (1)
- B4% (1)
- C81% (21)
- D12% (3)
Explanation
The MyBase keyword behaves like an object variable referring to the base class of the current instance of a class. MyBase is commonly used to access base class members that are overridden or shadowed in a derived class.
Topics
Community Discussion
No community discussion yet for this question.