Question: 21 -
Which of the following statements about virtual base classes is correct?
-
It is used to provide multiple inheritance.
-
It is used to allow multiple copies of base class in a derived class.
-
It is used to avoid multiple copies of base class in derived class.
-
It allows private members of the base class to be inherited in the derived class.
Answer:
It is used to avoid multiple copies of base class in derived class.
Solution not available.
Question: 22 -
What does the class definitions in following code represent?class Bike
{
Engine objEng;
};
class Engine
{
float CC;
};
-
Both A and B
-
has a relationship
-
kind of relationship
-
Inheritance
Answer:
has a relationship
Solution not available.
Question: 23 -
Constructor is executed when _____.
-
an object is used
-
an object goes out of scope.
-
an object is created
-
a class is declared
Answer:
an object is created
Solution not available.
Question: 24 -
How many objects can be created from an abstract class?
-
As many as we want
-
1
-
0
-
2
Answer:
0
Solution not available.
Question: 25 -
Which of the following means "The use of an object of one class in definition of another class"?
-
Inheritance
-
Encapsulation
-
Abstraction
-
Composition
Answer:
Composition