25. Which of the following concepts provides facility of using object of one class inside another class?
a. Encapsulation
b. Abstraction
c. Composition
d. Inheritance
Answer:c. Composition
26. How many types of polymorphisms are supported by C++?
a. 1
b. 2
c. 3
d. 4
Answer:b. 2
27. Which of the following statement is correct about a constructor?
a. A constructor is called at the time of declaration of an object.
b. A constructor call create a new object
c. A constructor initializes a newly created object
d. A constructor is called at the time of use of a class.
e. a and c
Answer:e. a and c
28. Function overloading increases the readability of the program because
a. you don't need to use different names for same action.
b. you don't need many functions
c. you don't need many arguments
Answer:a. you don't need to use different names for same action.
29. Which of the following concepts of OOPS means wrapping data (variables) and code together as a single unit?
a. Encapsulation
b. Abstraction
c. Data hiding
d. Data binding
Answer:a. Encapsulation
30. Which of the following is correct about function overloading?
a. The types of arguments are different.
b. The order of argument is different.
c. The number of argument is same.
d. Both a and b
Answer:d. Both a and b
31. Which of the following concepts means that the code to be executed for a specific procedure call is not known until run-time?
a. Dynamic binding
b. Late binding
c. Data binding
d. Dynamic loading
Answer:a. Dynamic binding
32. The purpose of constructor is to ________
a. Construct a new class
b. initialize the object of a class
c. Construct a new object
d. Construct a new function
Answer:b. initialize the object of a class
33. Is an exception a runtime error?
a. Yes
b. No
Answer:a. Yes
34. Late Binding in C++ can be achieved using
a. Static function
b. Const function
c. Operator function
d. Virtual function
Answer:d. Virtual function
35. Reusability is a desirable feature of a language because it _________
a. decreases the testing time.
b. lowers the maintenance cost.
c. reduces the compilation time.
d. Both a and b
Answer:d. Both a and b
36. Which of the following is an example of static polymorphism?
a. Operator overloading
b. Method Overriding
c. Method overloading
d. a and c
Answer:d. a and c
37. Which of the following concepts means wrapping the data variables and code acting on the methods together as a single unit?
a. Encapsulation
b. Abstraction
c. Polymorphism
d. Inheritance
Answer:a. Encapsulation
38. Choose the correct statement(s) regarding inline functions.
a. Less overhead and faster program execution
b. It increases the code size.
c. It slows down execution.
d. Both a and b
Answer:d. Both a and b
39. Which of the following is correct about class and structure?
a. class data members are public by default while that of structure are private.
b. class can have member functions while structure cannot.
c. class data members are private by default while that of structure are public by default.
d. Pointer to structure or classes cannot be declared.
Answer:c. class data members are private by default while that of structure are public by default.