Object Oriented Programming With Java Feb 2022
Object Oriented Programming With Java Feb 2022
Or
2 a) What are the drawbacks of procedural languages? Explain the need of object- [7M]
oriented programming with suitable program.
b) Explain various control structures used in JAVA with suitable examples. [7M]
Or
4 a) What is a constructor? What is its requirement in programming? Explain with [7M]
program.
b) Write about class, object, methods, constructor and destructor. [7M]
5 a) What do you understand by super key word? Write use of super key word. [3M]
b) Differentiate between Interface and Abstract class. When Interface is preferred [4M]
over Abstract class.
c) Write an Abstract class named Person and its two subclasses named Student and [7M]
Employee.
A person name, address, phone number and email address. A student has
enrollment, course. An employee has an office, salary and designation. Define
constructors and methods for input and display for both classes. Write a main
program to give demonstration of all.
Or
6 a) Define inheritance with diagrammatic illustration and java programs to illustrate [7M]
the different types of inheritance with an example.
b) Write the Java program to create anonymous objects using an Interface. [7M]
7 a) Describe the process of importing and accessing a package with suitable [7M]
examples.
b) Write the differences between the following classes Date, Calendar and [7M]
Gregorian Calendar and usage of time package.
Or
1 of 2
|''|''|||''|'''|||'|
Code No: R2021422 R20 SET - 1
8 a) Create a Car class in Package p1 which has its private member variables like [7M]
booleancentral_locking, byterain_sensors, Boolean automatic_headlight and has
abstract methods defined for getting and setting the values for these variables.
Create a concrete class implementation called as Gallardo in package p2, which
extends Car class and give the implementation for the abstract methods.
Create a main class to display the values of these variables using Gallardo object
and Car’s reference.
b) Differentiate between an Exception and an Error? How are Runtime exceptions [7M]
handled? Explain the syntax?
Or
10 a) Assuming that there are a list of 10 student objects, where each student object [7M]
has the following member variable {Name, roll no, attd%, CGPA}. You have to
write the logic for displaying the list of students whose attd% is less than 65%
using a JTable in increasing order of attendance
b) Write a JDBC program to search for an attribute in a table and display the entire [7M]
tuple to the user. For example, display all the details of the student given his/her
roll number.
2 of 2
|''|''|||''|'''|||'|