A.
Copy constructor
B.
Friend constructor
C.
Default constructor
D.
Parameterized constructor
Answer: Option B
2. How many instances of an abstract class can be created?
A.1
B.5
C.13
D.0
Answer: Option D
3.Multiple inheritance means,
(a) one class inheriting from more super classes
(b) more classes inheriting from one super class
(c) more classes inheriting from more super classes
(d) None of the above
(e) (a) and (b) above.
Answer : (a)
4.
In object oriented programming new classes can be defined by extending existing classes.
example of:
(a) (a)Encapsulation
(b) Interface
(c) (c)Composition
(d) Inheritance
(e) Aggregation.
Answer : (d)
5.The wrapping up of data and functions into a single unit is called
(a) Encapsulation
(b) Abstraction
(d) Polymorphism
Answer : (a)
This is an
(b).False
(c).0
(d).1
Answer : b
11.Assume five objects are created for a class;each object has its own copy of
(a) data members only
Answer : a
12.In java, new operator is used to create
(a) only primitive types
Answer : c
13.in java, garbage collection can be done done by
(a) only manually by user
Answer : b
C++
14. To expose a data member to the program, you must declare the data member in the _____
section of the class
A.
common
B.
exposed
C.
public
D.
unrestricted
E.
user
Answer : C
(B).
#include files
(C).
inheritance
(D).
Answer: Option C
16. A function that returns no values to the program that calls it is _____
(A).
(B).
type void
(C).
type empty
(D).
type barren
Answer: Option B
17.When a child class function is called, the compiler looks first for a matching function name in
the _____
(A).
(B).
(C).
base class
(D).
descendant class
Answer: Option A
18. A function that is called automatically each time an object is destroyed is a
(A).
constructor
(B).
destructor
(C).
destroyer
(D).
terminator
Answer: Option B
19. The type to be used in an instantiation of a class template follows ________
A.
B.
C.
D.
Answer: Option A
20. What does C++ append to the end of a string literal constant?
A.
a space
B.
C.
an asterisk (*)
D.
a null character
Answer: Option D
21. Overloaded functions are required to
A.
B.
C.
D.
Answer: Option D
22. A widget is to the blueprint for a widget as an object is to
A.
a member function
B.
a class
C.
an operator
D.
a data item
Answer: Option B
23. A base class may also be called a
A.
child class
B.
subclass
C.
derived class
D.
parent class
Answer: Option D
24.The step-by-step instructions that solve a problem are called _____
A.
an algorithm
B.
a list
C.
a plan
D.
a sequential structure
Answer: Option A
25. When you pass a variable _____, C++ passes only the contents of the variable to the
receiving function
A.
by reference
B.
by value
C.
globally
D.
locally
Answer: Option B