PVP 20
Code: 20AM3302, 20DS3302
II [Link] - I Semester – Regular/Supplementary Examinations
DECEMBER 2024
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
(Common for AIML, DS)
Duration: 3 hours Max. Marks: 70
Note: 1. This paper contains questions from 5 units of Syllabus. Each unit carries
14 marks and have an internal choice of Questions.
2. All parts of Question must be answered in one place.
UNIT – I
1. a) Define Array. Write a Java program to implement the 7M
addition of two matrices.
b) Explain how Java achieves platform-independence. 7M
Also list the features of Java.
OR
2. a) Explain different types of if statements in JAVA. 7M
b) Explain about scope & lifetime of a variable with 7M
example program.
UNIT – II
3. a) What are constructors? Explain two types of 7M
constructors with an example program.
b) Explain the use of this keyword in JAVA with an 7M
example.
OR
Page 1 of 3
4. a) Write a Java program to implement multilevel 7M
inheritance with 3 levels of hierarchy.
b) What is the importance of the super keyword in 7M
inheritance? Illustrate with a suitable example.
UNIT-III
5. a) Explain about the need of wrapper classes. Give 7M
examples.
b) Define package. Explain the steps involved in creating 7M
a user-defined package with an example.
OR
6. a) Write the differences between Abstract Classes and 7M
Interfaces.
b) List and briefly describe the methods provided by the 7M
Object class in Java. Provide a short explanation for
each method.
UNIT – IV
7. a) Define an exception. What are the key terms used in 7M
exception handling? Explain.
b) Write a program that contains one method that will 7M
throw an IllegalAccessException and use proper
exception handler so that the exception should be
printed.
OR
Page 2 of 3
8. a) What do you mean by a thread? Explain the different 7M
ways of creating threads.
b) What is the need of synchronization? Explain with an 7M
example how synchronization is implemented in JAVA.
UNIT – V
9. a) Define the purpose of the hashCode() and equals() 7M
methods in Java. Why are these methods important?
b) Assess the benefits and drawbacks of using 7M
synchronized collections versus concurrent collections
in various scenarios.
OR
10. a) What is the purpose of the ArrayList class in Java? 7M
Which methods are used to add and remove an element
to and from an ArrayList?
b) What is the method to add a key-value pair to a Map in 7M
Java? Explain.
Page 3 of 3