MCQ1 C++
MCQ1 C++
MCQ1 C++
Which of the following type of class allows only one object of it to be created?
A. Virtual class
B. Abstract class
C. Singleton class
D. Friend class
B. Friend constructor
C. Default constructor
D. Parameterized constructor
B. Friend function
C. Const function
D. Virtual function
5. Which of the following concepts means determining at runtime what method to
invoke?
A. Data hiding
B. Dynamic Typing
C. Dynamic binding
D. Dynamic loading
6. Which of the following term is used for a function defined inside a class?
A. Member Variable
B. Member function
C. Class function
D. Classic function
7. Which of the following concept of oops allows compiler to insert arguments in a
function call if it is not specified?
A. Call by value
B. Call by reference
C. Default arguments
D. Call by pointer
C. 13 D. 0
B. Class
C. Object
D. Operator function
10. Which of the following concepts of OOPS means exposing only necessary
information to client?
A. Encapsulation
B. Abstraction
C. Data hiding
D. Data binding
11. Why reference is not same as a pointer?
A. A reference can never be null.
C. object D. macro
13. Which of the following concepts provides facility of using object of one class
inside another class?
A. Encapsulation B. Abstraction
C. Composition D. Inheritance
C. 3 D. 4
C. string D. Class
16. Which of the following concepts means adding new components to a program
as it runs?
A. Data hiding
B. Dynamic typing
C. Dynamic binding
D. Dynamic loading
B. Transient polymorphism
C. Ad-hoc polymorphism
D. Pseudo polymorphism
C. Right-left D. Left-right
D. Both A and B.
21. Which of the following is correct about class and structure?
A. class can have member functions while structure cannot.
class data members are public by default while that of structure are
B.
private.
class data members are private by default while that of structure are
D.
public by default.
22. Which of the following concepts means wrapping up of data and functions
together?
A. Abstraction B. Encapsulation
C. Inheritance D. Polymorphism
23. Which of the following concepts means waiting until runtime to determine
which function to call?
A. Data hiding
B. Dynamic casting
C. Dynamic binding
D. Dynamic loading
B. <<
C. +
D. =
26. Which of the following is the correct class of the object cout?
A. iostream
B. istream
C. ostream
D. ifstream
B. member functions
C. constructor
D. destructor
D. Initialize objects
C. A syntax error.
D. A run-time error.
30. Which one of the following options is correct about the statement given below?
The compiler checks the type of reference in the object and not the type of
object.
A. Inheritance B. Polymorphism
C. Abstraction D. Encapsulation
31. Which of the following is the correct way of declaring a function as constant?
A. const int ShowData(void) { /* statements */ }
D. Both A and B
B. Operator function
C. Const function
D. Static function
D. Both A and B.
34. Which of the following factors supports the statement that reusability is a
desirable feature of a language?
A. It decreases the testing time.
D. Both A and B.
35. Which of the following ways are legal to access a class data member using this
pointer?
A. this->x
B. this.x
C. *this.x
D. *this-x
36. Which of the following is a mechanism of static polymorphism?
A. Operator overloading
B. Function overloading
C. Templates
37. Which of the following is correct about the statements given below?
All operators can be overloaded in C++.
We can change the basic meaning of an operator in C++.
A. Only I is true.
C. Only II is true.
38. What happens if the base and derived class contains definition of a function
with same prototype?
A. Compiler reports an error on compilation.
Base class object will call base class function and derived class object will
D.
call derived class function.
39. Which of the following are available only in the class hierarchy chain?
A. Public data members
D. Member functions
C. Distributive D. Hierarchical
41. Which of the following operators cannot be overloaded?
A. []
B. ->
C. ?:
D. *
42. In which of the following a virtual call is resolved at the time of compilation?
A. From inside the destructor.
D. Both A and B.
D. Both A and C.
44. Which one of the following is the correct way to declare a pure virtual function?
A. virtual void Display(void){0};
D. void Display(void) = 0;
B. ostream.h
C. iomanip.h
D. iostream.h
46. Which of the following keyword is used to overload an operator?
A. overload
B. operator
C. friend
D. override
C. It is not allowed.
D. Both A and B.
B. Multiple inheritance
C. Hybrid inheritance
D. Hierarchical Inheritance
49. Which one of the following is correct about the statements given below?
All function calls are resolved at compile-time in Procedure Oriented
Programming.
All function calls are resolved at compile-time in OOPS.
A. Only II is correct.
C. Only I is correct.
50. Which of the following is an invalid visibility label while inheriting a class?
A. public
B. private
C. protected
D. friend
51. Which one of the following options is correct?
A. Friend function can access public data members of the class.
54. Which of the following access specifier is used as a default in a class definition?
A. protected B. public
C. private D. friend
B. A static data member is shared among all the object of the class.
D. Both A and B.
56. Which of the following provides a reuse mechanism?
A. Abstraction
B. Inheritance
C. Dynamic binding
D. Encapsulation