Filters
Question type

Study Flashcards

OOP implements ____.


A) UML
B) IPE
C) EIP
D) OOD

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

The constructors of a derived class can (directly) initialize only the (public data) members inherited from the base class of the derived class.

A) True
B) False

Correct Answer

verifed

verified

Consider the following class definition: Consider the following class definition:   The class dClass is derived from the class bClass using the ____ type of inheritance. A)  public B)  private C)  protected D)  static The class dClass is derived from the class bClass using the ____ type of inheritance.


A) public
B) private
C) protected
D) static

E) A) and D)
F) All of the above

Correct Answer

verifed

verified

Which of the following is true about a derived class?


A) A derived class can directly access any member variable of the base class.
B) A derived class can redefine any public member function of the base class.
C) A derived class can have at most one base class.
D) A derived class can redefine any member function of the base class.

E) B) and C)
F) None of the above

Correct Answer

verifed

verified

In multiple inheritance, the derived class has more than one base class.

A) True
B) False

Correct Answer

verifed

verified

C++ provides ____________________ functions as a means to implement polymorphism in an inheritance hierarchy.

Correct Answer

verifed

verified

Which of the following is a valid definition of the derived class bClass?


A) class aclass: public bClass
{
//... / / . . .
};
B) Class bClass: public aClass
{
//... / / . . .
};
C) Class aClass: bClass
{
//... / / . . .
};
D) class bClass: aClass
{
//... / / . . .
};

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

If inheritance is private, all members of the base class, including private members, become private members of the derived class.

A) True
B) False

Correct Answer

verifed

verified

Consider the following class definitions:Which of the following dClass constructor definitions is valid in C++? Consider the following class definitions:Which of the following dClass constructor definitions is valid in C++?    A)    B)    C)    D)


A) Consider the following class definitions:Which of the following dClass constructor definitions is valid in C++?    A)    B)    C)    D)
B) Consider the following class definitions:Which of the following dClass constructor definitions is valid in C++?    A)    B)    C)    D)
C) Consider the following class definitions:Which of the following dClass constructor definitions is valid in C++?    A)    B)    C)    D)
D) Consider the following class definitions:Which of the following dClass constructor definitions is valid in C++?    A)    B)    C)    D)

E) All of the above
F) A) and B)

Correct Answer

verifed

verified

To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have the same name, number, and types of parameters.


A) redefine
B) overload
C) rename
D) reuse

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

If inheritance is public, all protected members of the base class are ____________________ members of the derived class.

Correct Answer

verifed

verified

The private members of a base class can be directly accessed by a derived class.

A) True
B) False

Correct Answer

verifed

verified

The constructor of a derived class cannot directly access the ____________________ member variables of the base class.

Correct Answer

verifed

verified

The ____ members of an object form its internal state.


A) private
B) protected
C) public
D) static

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

Inheritance is an example of a(n) ____ relationship.


A) is-a
B) has-a
C) handshaking
D) had-a

E) B) and D)
F) A) and C)

Correct Answer

verifed

verified

In ____________________ (aggregation), one or more members of a class are objects of another class type.

Correct Answer

verifed

verified

A call to the base class's constructor is specified in the heading of the definition of a derived class constructor.

A) True
B) False

Correct Answer

verifed

verified

If the derived class does not override a public member function of the base class, you may specify a call to that public member function by using the name of the function and the appropriate parameter list.

A) True
B) False

Correct Answer

verifed

verified

A derived class can directly access the protected members of the base class.

A) True
B) False

Correct Answer

verifed

verified

If the corresponding functions in the base class and the derived class have the same name but different sets of parameters, then this function is ____ in the derived class.


A) reused
B) redefined
C) overloaded
D) overridden

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

Showing 21 - 40 of 41

Related Exams

Show Answer