

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Assume that the Vehicle class contains a virtual method named CalculateMaxSpeed(). Assume that both the MotorVehicle and Automobile classes override this method. Which class defines the method that is called when the second statement in the code that follows is executed? MotorVehicle car = new Automobile(); car.CalculateMaxSpeed(); - Automobile A class can - be both a base class and a derived class If a method accepts an Object type, what types of objects can it accept? - All objects In the System.Windows.Forms namespace, the Control class - provides properties and methods that all controls in the namespace have in common Which of the following declarations defines a Student class that inherits a Person class?
The ToString(), Equals(), and GetHashCode() methods are available to all objects because they are - members of the System.Object class, which all objects inherit ode example 14- public class SavingsAccount : Account { public SavingsAccount() : base() { base.Type = "Savings"; } public SavingsAccount(int number) : base(number) { base.Type = "Savings"; } public SavingsAccount(int number, decimal balance) : base(number, "Savings", balance) { } } (Refer to code example 14-1.) Which of the following statements creates an object of the Account class? - Account account = new Account(111, "Checking", 0.0m); The GetType() method of an object returns - a Type object that contains information about the object's type What type of class can't be inherited by another class? - a sealed class A protected method defined within a base class is available to - both the base class and classes derived from it If the Student class inherits the Person class and overrides a virtual method named GetBirthday(), which method does the third statement in the following code example call? Student s = new Student("Albert Einstein"); Person p = s; p.GetBirthday(); - the GetBirthday() method defined in the Student class Which of the following operators can you use to test if an object has a specific type? - typeof Which keyword do you use to declare a method or property that can be overridden by a derived class? - virtual