Quiz 4

¡Supera tus tareas y exámenes ahora con Quizwiz!

When one object is a specialized version of another object, there is a(n) ________ between them.

"is a" relationship

With what value should the accumulator variable be initialized to calculate the total of the values in a numeric array?

0

Which one of the following is a class header indicating that we are defining a class named Amphibian, and it is derived from the Animal class?

Amphibian : Animal

A class that is not intended to be instantiated but is to be used only as a base class is called a concrete class.

False

A method that accepts a base class variable as a parameter cannot accept a derived class variable as a parameter.

False

If a base class object is used to call an overridden method, then the derived class's version of the method is the one that executes.

False

Inheritance involves a base class and a relative class.

False

New fields, properties, and methods cannot be added to the derived class.

False

Only methods in the derived class can directly access the base class's private members.

False

You can use the ________ to insert an item at a specific index in a List.

Insert method

You can use the ________ to remove an item at a specific index in a List.

RemoveAt method

If you want to show a form in modeless fashion, call its ________.

Show method

The ________ method returns true if the string object starts with the substring or false otherwise.

StartsWith

When you need to convert a char variable to a string, you can call its ________ method.

ToString

A statement that tries to use the new operator instantiate an abstract class will not compile.

True

If the base class does not have a parameterless constructor, the derived class constructor must use the notation: base(parameterList) to call one of the base class's parameterized constructors.

True

If the derived class introduces additional methods, properties, or fields, as base class reference variable cannot access them.

True

If you want to create an abstract read-only property, leave out the set accessor.

True

In the real world you can find many objects that are specialized versions of more general objects.

True

Properties in a base class can be overridden in the same way that methods can be overridden.

True

When an "is a" relationship exists between objects, it means that the specialized object has all of the characteristics of the general object, plus additional characteristics that make it special.

True

When designing an object-oriented program, the best approach is to write a base class to hold all the general data about an object and then write derived classes for each specific type of object.

True

When you create a derived class, the base class constructor is executed first, and then the derived class constructor is executed.

True

You can think of the derived class as an extended version of the base class.

True

You cannot assign a base class reference to a derived class variable.

True

A class that is not intended to be instantiated but is to be used only as a base class is called a(n) ________.

abstract class

To declare a class as abstract, you use the ________ in the class header.

abstract keyword

A(n) ________ is a method that appears in a base class but expects to be overridden in a derived class.

abstract method

A(n) ________ is a property that appears in a base class but expects to be overridden in a derived class.

abstract property

Which one of the following is a specialized version of a general food substance?

all of these

A base class reference variable knows only about the members that are declared in the ________.

base class

The ________ is the general class.

base class

To allow a property to be overridden in the ________ you write the virtual keyword in the property declaration.

base class

When you want to make sure a specific constructor from the base class is used, the derived class constructor must explicitly call the base class constructor using the ________.

base keyword

When you pass a property as an argument to a method, there is one restriction: Properties can be passed only ________.

by value

Assuming that cat1 and cat2 are both instances of the Pet structure, which one of the following statements assigns cat1 to cat2?

cat2 = cat1;

A regular class is sometimes called a(n) ________.

concrete class

Which one of the following statements is not a valid array declaration?

decimal[] sales = new decimal[24.5m];

The ________ inherits fields, properties, and methods from the base class without any of them having to be rewritten.

derived class

To override the property in the ________ you write the override keyword in the property declaration.

derived class

In object oriented programming, ________ is used to create an "is a" relationship among classes.

inheritance

The ________ declares that a method in the derived class overrides a method in the base class.

override keyword

When a derived class method has the same name as a base class method, it is often said that the derived class method ________ the base class method.

overrides

A(n) ________ is a class constructor that accepts no arguments.

parameterless constructor

The term ________ refers to an object's ability to take different forms.

polymorphism

Look at the following code sample:string tree = "Pear";char letter = tree[3];Which one of the following values is stored in the letter variable?

r

Subscript notation provides ________ access to the individual characters in a string.

read-only

The compiler uses a method's ________ to distinguish it from other methods of the same name.

signature

Base classes are sometimes called superclasses, and derived classes are sometimes called ________.

subclasses

The ________ declares that a derived class is allowed to override a method in the base class.

virtual keyword


Conjuntos de estudio relacionados

CRCM Study Flash Cards Tier 1 Regulations - Non Reg Z

View Set

AP World Unit 6 Practice Quizzes

View Set

California Real Estate Salespersons Course Gollasary

View Set

Advantages and disadvantages of air masses

View Set

money, inflation & quantity theory

View Set

ServSafe Unit II: The Flow of Food Through the Operation

View Set