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?
Suggested Answer:C🗳️
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.
Answer B seems more appropriate. The question states how should you access the "Truck class" implementation of the brake() method. MyBase.brake() would access Vehicle.brake().
I agree with this, it states the "Truck class" implementation, calling MyBase.brake or base.Brake would call the Vehicle class' implementation of brake.
nvm, read the question wrong.
in overriden methods called in the derived class that overrode the method
this.break() calls the implementation of the derived class
base.break() calls the implementations of the base class
"...How should you call the Truck class implementation of the brake () method?"
As far as I understood it you need to call the .Break() over a new instance of Truck. Truck does not have a declaration of Break to be called.
Yes, this is in VB.Net
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/me-my-mybase-and-myclass
upvoted 2 times
...
...
This section is not available anymore. Please use the main Exam Page.98-361 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Difdoor
Highly Voted 3 years, 5 months agoJamieS
1 year, 1 month agoHashino
2 years, 11 months agoHashino
2 years, 11 months agorbishun
Most Recent 6 months, 3 weeks ago[Removed]
8 months, 3 weeks agoHeicke
1 year, 4 months agoKinC
1 year, 5 months agoccoutinho
2 years, 9 months agoJoelChuca
2 years, 2 months ago