Filters
Question type

Study Flashcards

If the derived class classD overrides a public member function functionName of the base class classB, then to specify a call to that public member function of the base class, you use the statement ____.


A) classD::functionName() ;
B) classB::functionName() ;
C) classD.functionName() ;
D) classB.functionName() ;

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

Correct Answer

verifed

verified

Suppose that bClass is a class. Which of the following statements correctly derives the class dClass from bClass?


A) class dClass:: public bClass
{
//classMembersList
};
B) class dClass: private bClass
{
//classMembersList
};
C) class dClass:: protected bClass
{
//classMembersList
};
D) class bClass: public dClass
{
//classMembersList
};

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

Correct Answer

verifed

verified

Classes can create new classes from existing classes. This important feature ____.


A) encourages code reuse
B) aids the separation of data and operations
C) provides public access to the internal state of an object
D) results in more software complexity

E) B) and C)
F) All 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

OOP implements ____.


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

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

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 C)
F) A) and B)

Correct Answer

verifed

verified

The preprocessor directive ____________________ is used to prevent multiple inclusions of a header file in a program.

Correct Answer

verifed

verified

____ is the ability to combine data, and operations on that data, in a single unit.


A) Inheritance
B) Encapsulation
C) Polymorphism
D) Composition

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

Correct Answer

verifed

verified

____ is the ability to use the same expression to denote different operations.


A) Inheritance
B) Encapsulation
C) Polymorphism
D) Composition

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

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

The ____ members of an object form its external state.


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

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

Correct Answer

verifed

verified

____ is a "has-a" relationship.


A) Inheritance
B) Encapsulation
C) Composition
D) Polymorphism

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

Correct Answer

verifed

verified

In OOD, a program is a collection of interacting ____________________; in structured programming, a program is a collection of interacting functions.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Which of the following is true about inheritance?


A) All public member functions of the base class become the public member functions of the derived class.
B) All public member variables of the base class become the public member variables of the derived class.
C) All public members of the base class become the public members of the derived class.
D) The public member variables of the base class become the public or private member variables of the derived class.

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

Correct Answer

verifed

verified

The ____ members of an object form its internal state.


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

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

Correct Answer

verifed

verified

The class io is the base class of the C++ stream classes istream and ostream.

A) True
B) False

Correct Answer

verifed

verified

What is the output of the following program? What is the output of the following program?   A)  2 3 2 3 B)  2 3 3 5 8 C)  3 5 8 3 5 8 D)  5 8 3 5 8


A) 2 3
2 3
B) 2 3
3 5 8
C) 3 5 8
3 5 8
D) 5 8
3 5 8

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

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

Existing classes, from which you create new classes, are called ____ classes.


A) child
B) base
C) sibling
D) derived

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

Correct Answer

verifed

verified

Showing 21 - 40 of 41

Related Exams

Show Answer