OBJECT ORIENTED PROGRAMMING MCQ's SET-1
1. Which was the first purely object oriented programming language developed?
a) Java
b) C++
c) Small Talk
d) Kotlin
Answer: c
2. Which of the following best defines a class?
a) Parent of an object
b) Instance of an object
c) Blueprint of an object
d) Scope of an object
Answer: c
3. Who invented OOP?
a) Alan Kay
b) Andrea Ferro
c) Dennis Ritchie
d) Adele Goldberg
Answer: a
4. What is the additional feature in classes that was not in structures?
a) Data members
b) Member functions
c) Static data allowed
d) Public access specifier
Answer: b
5. Which is not feature of OOP in general definitions?
a) Code reusability
b) Modularity
c) Duplicate/Redundant data
d) Efficient Code
Answer: c
6. Pure OOP can be implemented without using class in a program. (True or False)
a) True
b) False
Answer: b
7. Which Feature of OOP illustrated the code reusability?
a) Polymorphism
b) Abstraction
c) Encapsulation
d) Inheritance
Answer: d
8. Which language does not support all 4 types of inheritance?
a) C++
b) Java
c) Kotlin
d) Small Talk
Answer: b
9. How many classes can be defined in a single program?
a) Only 1
b) Only 100
c) Only 999
d) As many as you want
Answer: d
10. When OOP concept did irst came into picture?
a) 1970’s
b) 1980’s
c) 1993
d) 1995
Answer: a
11. Why Java is Partially OOP language?
a) It supports usual declaration of primitive data types
b) It doesn’t support all types of inheritance
c) It allows code to be written outside classes
d) It does not support pointers
Answer: a
12. Which concept of OOP is false for C++?
a) Code can be written without using classes
b) Code must contain at least one class
c) A class must have member functions
d) At least one object should be declared in code
Answer: b
13. Which header file is required in C++ to use OOP?
a) iostream.h
b) stdio.h
c) stdlib.h
d) OOP can be used without using any header file
Answer: d
14. Which of the two features match each other?
a) Inheritance and Encapsulation
b) Encapsulation and Polymorphism
c) Encapsulation and Abstraction
d) Abstraction and Polymorphism
Answer: c
15. Which feature allows open recursion, among the following?
a) Use of this pointer
b) Use of pointers
c) Use of pass by value
d) Use of parameterized constructor
Answer: a
16. Which is known as a generic class?
a) Abstract class
b) Final class
c) Template class
d) Efficient Code
Answer: c
a) Abstract Class
b) Final Class
c) Start Class
d) String Class
Answer: c
18. Class is pass by _______
a) Value
b) Reference
c) Value or Reference, depending on program
d) Copy
Answer: b
19. 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
Answer: a
20. Which is most appropriate comment on following class definition?
class Student { int a; public : float a; };
a) Error : same variable name can’t be used twice
b) Error : Public must come first
c) Error : data types are different for same variable
d) It is correct
Answer: a