Exam 10: Introduction to Inheritance

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Explain the sequence of constructors that will be called when you create an object that is an instance of a derived class.

(Essay)
4.8/5
(35)

What are the requirements for overloading the Object class's Equals() method?

(Essay)
4.8/5
(37)

A(n) ____________________ method is one that can be overridden by a method with the same signature in a child class.

(Short Answer)
4.9/5
(30)

When presented with two classes that have a parent-child relationship, you can tell which class is the base class and which is the derived class by using the two classes in a sentence with the phrase ____.

(Multiple Choice)
4.9/5
(39)

You can assign a derived class object to an object of any of its superclass types. When you do, C# makes a(n) ____ conversion from derived class to base class.

(Multiple Choice)
4.8/5
(33)

Briefly describe the similarities and differences between abstract classes and interfaces.

(Essay)
4.8/5
(42)

A ____ is sometimes called a "fingerprint" for an object because it uniquely identifies the object.

(Multiple Choice)
4.8/5
(33)

A(n) ____ is a synonym for a base class.

(Multiple Choice)
4.9/5
(29)

The ____ Object class method returns a string that holds the name of the class, just as GetType() does.

(Multiple Choice)
4.9/5
(29)

A(n) ____ method has no method statements; any class derived from a class that contains one must override it by providing a body.

(Multiple Choice)
4.8/5
(42)

On some occasions, you might want to access parent class data from a child class. Declaring the parent class field as public would violate the principle of information hiding, but declaring it private would make it inaccessible. How can the proper level of security be achieved?

(Essay)
4.8/5
(38)

____________________ are methods that you can write to add to any type, even if you did not create the original class.

(Short Answer)
4.9/5
(44)

C# makes implicit conversions when casting one data type to another. When a derived class object is assigned to its ancestor's data type, the conversion can more specifically be called a(n) ___________________________________.

(Short Answer)
4.8/5
(44)

The Equals() method compares two objects and returns true if they have the same value.

(True/False)
4.8/5
(37)

A ____ is a synonym for a derived class.

(Multiple Choice)
4.8/5
(36)

When you declare a property defined in a base class as override in a derived class, this new declaration overrides and ____ its counterpart in the parent class.

(Multiple Choice)
4.9/5
(37)
Match each item with a statement below:
The ultimate base class for all other types
GetType()
Using the same method name to indicate different implementations
polymorphism
Also known as a derived class
Equals()
Correct Answer:
Verified
Premises:
Responses:
The ultimate base class for all other types
GetType()
Using the same method name to indicate different implementations
polymorphism
Also known as a derived class
Equals()
Returns true if two Object s have the same memory address
System.Object
A synonym for base class
extended class
Can be used by a class and its descendants
reference equality
A class that cannot be extended
superclass
Returns a string containing an object's class
protected members
Occurs when two reference type objects refer to the same object
sealed class
(Matching)
5.0/5
(45)

A class that inherits from a base class is a ____.

(Multiple Choice)
4.7/5
(37)

In C#, you can use either new or ____ when defining a derived class member that has the same name as a base class member.

(Multiple Choice)
4.8/5
(39)

A class that is used as a basis for inheritance is called a(n) ____.

(Multiple Choice)
5.0/5
(34)
Showing 21 - 40 of 42
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)