Quiznetik
Object Oriented Programming Using C++ | Set 1
1. Which of the two features match each other?
A. Inheritance and Encapsulation
B. Encapsulation and Polymorphism
C. Encapsulation and Abstraction
D. Abstraction and Polymorphism
Correct : C. Encapsulation and Abstraction
2. What is default access specifier for data members or member functions declared within a class without any specifier, in C++?
A. Private
B. Protected
C. Public
D. Depends on Compiler
Correct : A. Private
3. If a function can perform more than 1 type of tasks, where the function name remains same, which feature of OOP is used here?
A. Encapsulation
B. Inheritance
C. Polymorphism
D. Abstraction
Correct : C. Polymorphism
4. Which feature in OOP is used to allocate additional function to a predefined operator in any language?
A. Operator Overloading
B. Function Overloading
C. Operator Overriding
D. Function Overriding
Correct : A. Operator Overloading
5. Which among the following best defines abstraction?
A. Hiding the implementation
B. Showing the important data
C. Hiding the important data
D. Hiding the implementation and
Correct : D. Hiding the implementation and
6. A base class is also known as class.
A. Basic
B. Inherited
C. Super
D. Sub
Correct : C. Super
7. If class A is derived from another derived class B which is derived from class C, which class will have maximum level of abstraction?
A. Class A
B. Class B
C. Class C
D. All have the same level of abstraction
Correct : C. Class C
8. Derived class is also known as
A. Sub Class
B. Small Class
C. Big Class
D. Noticeable Class
Correct : A. Sub Class
9. Which of the following gets called when an object is being created?
A. Constructor
B. Virtual Function
C. Destructors
D. Main
Correct : A. Constructor
10. Destructor has a same name as the constructor and it is preceded by?
A. !
B. ?
C. ~
D. $
Correct : C. ~
11. Which of the following is called address operator?
A. *
B. &
C. _
D. %
Correct : B. &
12. Which of the following is used for comments in
A. //comment
B. /comment
C. *comment
D. ?comment
Correct : A. //comment
13. What is used to read from the console in C++?
A. cin
B. scanf
C. read
D. getline
Correct : A. cin
14. What is used to write/display to the console in C++?
A. printf
B. cout
C. write
D. putline
Correct : B. cout
15. Which operator is used with cin ?
A. >>
B. <<
C. >
D. <
Correct : A. >>
16. Which operator is used with cout?
A. >>
B. <<
C. >
D. <
Correct : B. <<
17. Which feature of OOP indicates code reusability?
A. Encapsulation
B. Inheritance
C. Abstraction
D. Polymorphism
Correct : B. Inheritance
18. Which feature can be implemented using
A. Inheritance
B. Abstraction
C. Polymorphism
D. Overloading
Correct : B. Abstraction
19. Which of the following is not a type of Constructor?
A. Friend constructor
B. Copy constructor
C. Default
D. Parameterized
Correct : A. Friend constructor
20. What is the other name used for functions inside a
A. Member variables
B. Member functions
C. Class functions
D. Class variables
Correct : B. Member functions
21. Which among the following can restrict class members to get inherited?
A. Private
B. Protected
C. Public
D. All three
Correct : A. Private
22. Which type of members can’t be accessed in derived classes of a base class?
A. Protected
B. Private
C. Public
D. All can be accessed
Correct : B. Private
23. Which of the following is true?
A. All objects of a class share all data members of class
B. Objects of a class do not share non-static members. Every object has its own copy
C. Objects of a class do not share codes of non-static
D. None of these
Correct : B. Objects of a class do not share non-static members. Every object has its own copy
24. Which among the following is not true for polymorphism?
A. It is feature of OOP
B. Ease in readability of program
C. Helps in redefining the
D. Increases overhead of function
Correct : D. Increases overhead of function
25. If different properties and functions of a real world entity is grouped or embedded into a single element, what is it called in OOP language?
A. Inheritance
B. Polymorphism
C. Abstraction
D. Encapsulation
Correct : D. Encapsulation
26. If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called?
A. Inheritance
B. Overloading
C. Polymorphism
D. Overriding
Correct : C. Polymorphism
27. Out of the following, which is not a member of the
A. Static function
B. Friend function
C. Const function
D. Virtual function
Correct : B. Friend function
28. Which of the following is an abstract data type?
A. int
B. float
C. class
D. string
Correct : C. class
29. Which of the following is not a type of inheritance?
A. Multiple
B. Multilevel
C. Distributive
D. Hierarchical
Correct : C. Distributive
30. Which of the following is correct in C++?
A. Classes cannot have protected data members
B. Structures can have member functions
C. Class members are public by default
D. Structure members are private by default
Correct : B. Structures can have member functions