MCQ Oops
MCQ Oops
3. Which was the first purely object oriented programming language developed?
a) Kotlin
b) SmallTalk
c) Java
d) C++
11. The feature by which one object can interact with another object is _____________
a) Message reading
b) Message Passing
c) Data transfer
d) Data Binding
12. Which among the following, for a pure OOP language, is true?
a) The language should follow at least 1 feature of OOP
b) The language must follow only 3 features of OOP
c) The language must follow all the rules of OOP
d) The language should follow 3 or more features of OOP
13. How many types of access specifiers are provided in OOP (C++)?
a) 4
b) 3
c) 2
d) 1
14. In multilevel inheritance, which is the most significant feature of OOP used?
a) Code efficiency
b) Code readability
c) Flexibility
d) Code reusability
17. Which constructor will be called from the object created in the below C++ code?
class A
{
int i;
A()
{
i=0; cout<<i;
}
A(int x=0)
{
i=x; cout<<I;
}
};
A obj1;
a) Parameterized constructor
b) Default constructor
c) Run time error
d) Compile time error
20. In which access should a constructor be defined, so that object of the class can be
created in any function?
a) Any access specifier will work
b) Private
c) Public
d) Protected
True False Questions
21. In Java, every class inherits from the Object class.
a. True.
b. False
a. True.
b. False
a. True.
b. False
a. True.
b. False
25. Encapsulation ensures that sensitive data is accessible only within the same class.
a. True.
b. False
26. All variables declared within an interface are implicitly static and final.
a. True.
b. False
27. In Java, the 'extends' keyword is used to implement inheritance between classes.
a. True.
b. False
a. True.
b. False
a. True.
b. False
30. The 'super' keyword in Java is used to call the superclass constructor explicitly.
a. True.
b. False
a. True.
b. False
32. In Java, method overriding is based on the signature of the method only, not its
return type.
a. True.
b. False
a. True.
b. False
34. In Java, the 'final' keyword can be used to prevent a method from being
overridden.
a. True.
b. False
35. Java's garbage collection mechanism ensures that memory leaks never occur.
a. True.
b. False
a. True.
b. False
37. In Java, the 'this' keyword refers to the current instance of the class.
a. True.
b. False .
a. True.
b. False
39. The 'implements' keyword is used in Java to declare inheritance between classes.
a. True.
b. False
a. True.
b. False
Answer Key
S/N ANSWERS
1 C
2 D
3 B
4 C
5 D
6 A
7 B
8 C
9 B
10 A
11 B
12 C
13 B
14 D
15 A
16 B
17 D
18 A
19 B
20 C
21 T
22 T
23 F
24 F
25 T
26 T
27 T
28 F
29 F
30 T
31 F
32 T
33 T
34 T
35 F
36 F
37 T
38 F
39 F
40 T
DISCRIPTIVE PAPER
1. Explain the concept of inheritance in Java with an example. Discuss its advantages and
limitations.
2. Describe the difference between abstract classes and interfaces in Java. Provide
examples to illustrate their usage.
3. What is polymorphism in Java? How does it help in achieving flexibility and reusability in
code? Provide examples.
4. Discuss the significance of encapsulation in object-oriented programming. How does
Java support encapsulation? Provide code examples.
5. Explain the concept of exception handling in Java. Discuss the role of try, catch, and
finally blocks in handling exceptions.
6. Describe the various access modifiers in Java (public, private, protected, and default).
Provide examples to illustrate their usage.
7. What are the differences between the == operator and the equals() method in Java?
Provide examples to demonstrate their usage.
8. Discuss the importance of interfaces in Java. How do interfaces facilitate multiple
inheritance? Provide an example.
9. Explain the concept of method overloading and method overriding in Java. Provide
examples to illustrate each concept.
10. Describe the purpose and usage of the static keyword in Java. Discuss static variables,
methods, and blocks.