0% found this document useful (0 votes)
8 views2 pages

Insem OOP (2021)

The document outlines the instructions and exam questions for the III Semester B.Tech In-Semester Examinations in Object Oriented Programming, scheduled for December 16, 2021. It includes six questions covering topics such as multiple inheritance, exception handling, constructors, collections, interfaces vs. abstract classes, and file handling in Java. Each question requires the candidate to provide explanations and suitable Java programs demonstrating the concepts discussed.

Uploaded by

batmanflyinsky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Insem OOP (2021)

The document outlines the instructions and exam questions for the III Semester B.Tech In-Semester Examinations in Object Oriented Programming, scheduled for December 16, 2021. It includes six questions covering topics such as multiple inheritance, exception handling, constructors, collections, interfaces vs. abstract classes, and file handling in Java. Each question requires the candidate to provide explanations and suitable Java programs demonstrating the concepts discussed.

Uploaded by

batmanflyinsky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

III SEM. B.

TECH (DSE) IN-SEMESTER EXAMINATIONS


Dec 2021
SUBJECT: OBJECT ORIENTED PROGRAMMING [DSE-2153] Date
of Exam: 16/12/2021 Time of Exam: 10:30 am– 12:00 noon Max. Marks: 20

Instructions to Candidates:
❖ Answer ALL the questions
❖ Missing data may be suitable assumed
1 Explain multiple inheritances using an abstract class with respective syntax. Write a 4
suitable program to demonstrate the same using the following scenario:

Create a “Movie” class with two methods as “plot()” and “getName()”. Extend a
minimum of Five movies as different classes from the base class Movies and
redefined “plot()” and “getName()” as their methods. Display method overloading.
For every random number generated in the main class, the respective movie name
with the plot should be displayed. Show how super, this and final keywords are used.

2 Differentiate between compile time and runtime exception with respective examples. 4
Write a suitable program to demonstrate the same using the following scenario:

Design a Java program to search the name of a Student from a class. Assume an array
of 5 students with respective details (RegNo, FirstName, LastName, Course). When a
student has to be searched, his “FirstName” should be given as input and we search
using string manipulation. [Note: create a minimum 5 student objects as array
elements and handle “ArrayIndexOutOfBoundsException” and
“InputMismatchException”]

3 Why are constructors important in object-oriented programming? Write a suitable 3


program to show the uses of constructors using the program for following scenario:

Create a “Mobile” class that holds 5 Mobile objects. The Mobile class shall take 5
attributes from the user as “modelID” (int), “ram” (int), “company_name” (String),
“isTouchScreen” (boolean) and “price” (double). Write two methods as
“mobileDetails()” and “mobilePrice()” to display details of mobile and price
associated with the mobileID. Show constructor overloading in passing parameters
to the above methods.

4 What are the differences between List and Set in Java? Write a suitable program to 3
demonstrate them using the following scenario:

The Class “Home” has a list “furniture” and a set “electricalAppliances” to store 10
string items of the home. If there is no item to enter, then collections will have “Null”
items. Class “Home” has methods “read”, “check” and “display” to do the
corresponding tasks. The method “check” throws “DuplicateItemFoundException”
when “furniture” and “electricalAppliances” have duplicate items in the collection.
Page 1 of 2

The class “MainClass” creates an array of “Home” objects to store items for 5 homes.

5 What would be your choice between interface and abstract class for the following 3
scenario. Give two reasons for your choice.

Write a suitable program to demonstrate the same using the following scenario: The
class “Bike” has “gearsCount” and “passengerCount”. The class “Car” has
“gearsCount” and “passengerCount”. The class “Vehicle” uses “Bike” and “Car” to
decide the vehicle detail entered is 2-Wheeler or 4-Wheeler in method “input”.

6 Write a program to read all lines from the file “sample.txt” in class “ReadLine” and 3
stores them in string “s1”. The method “process” searches for string “s2” and
replaces it with string “s3”. The updated string “s1” is stored in the file “updated.txt”
through method “fileUpdate”. The main class “MainClass” creates objects and calls
the methods to do tasks. Consider suitable exceptions in the program.

Page 2 of 2

You might also like