[Link].
Code No: CT3511 SRGEC-R20
II [Link] I Semester Supplementary Examinations, June 2025
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
(Computer Science and Engineering, Artificial Intelligence and Data Science, CSE(Artificial
Intelligence and Machine Learning) & Information Technology)
Time: 3 Hours Max. Marks: 70
Note: Answer one question from each unit.
All questions carry equal marks.
5 × 14 = 70M
UNIT-I
1. Classify and explain the types of Wrapper Classes. (14M)
(OR)
2. a) Write a Java program to perform multiplication of two matrices. (8M)
b) Write a Java Program to print the following pattern (6M)
*
**
***
****
UNIT-II
3. a) Write about preventing a class from being inherited in java with example program.
(7M)
b) Illustrate the procedure to define and access method in a class with suitable example
program. (7M)
(OR)
4. a) Assume a situation where the super class and sub class are having 2 data members with
same name i,j . When we try to access i,j in sub class, then which members(super class or
sub class) will be accessed and why. Is there any way to access super class members in
subclass(if they are having same name)? If yes, use the approach to access super class data
members i,j in sub class, show this with an example program. (7M)
b) “A super reference variable can reference to a sub class object”. Justify this statement.
(7M)
UNIT-III
5. a) Develop a Java program to add and remove elements in Hash set. (7M)
b) Differentiate between user-defined and predefined packages in Java. (7M)
(OR)
Page 1 of 2
6. a) Create and access a user defined package where the package contains a class named
CircleDemo, which in turn contains a method called circleArea() which takes radius of the
circle as the parameter and returns the area of the circle. (7M)
b) Differentiate between class and interface. (7M)
UNIT-IV
7. a) Develop a Java Program to display even numbers upto 50 by a thread and odd numbers
upto 50 by another thread concurrently, with two seconds delay by using Thread class.
(8M)
b) Develop a java program to create and handle a user defined exception named
“MarksOutOfRangeException”. When the user enters marks less than 0 and greater than
15, MarksOutOfRangeException is to be thrown. (6M)
(OR)
8. a) Can we have a try block without catch block. Justify your answer with appropriate
example code. (7M)
b) Differentiate between Multi-Threading and Multi-Tasking. (7M)
UNIT-V
9. a) Differentiate between an Applet and an Application. (6M)
b) Design an Applet to display the position of x and y co-ordinates of the cursor movement
using mouse. (8M)
(OR)
10. a) Create an applet with Red as its background colour and display “SRGEC” text on applet
window in white color. (8M)
b) Compare AWT and Swing Components. (6M)
*****
Page 2 of 2