How should you call the Truck Class implementation of the brake () method?

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?

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?

A.
Mybase.brake ()

B.
Truck.brakef)

C.
Vehicle.brake()

D.
Me.brake ()

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.



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Serge

Serge

there is not such thing as Mybase in C#

JD82

JD82

B. Truck.brake()

G-Unit

G-Unit

The answer is D. Me.brake() in VB.NET is equivalent to this.brake() in C#.

Nikesh

Nikesh

In VB, mybase is used to refer to base class