Home /University Of Sargodha (UOS) /Object Oriented Programming

Object Oriented Programming ADP 3 Semester/Term University Of Sargodha (UOS) 2025

Object Oriented Programming ADP 3 Semester/Term University Of Sargodha (UOS) 2025 — page 1

Discussion

Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.

Your email is only used to send you replies and occasional Ustadni updates. It is never shown publicly.

Log in to post under your name

No questions yet — be the first to ask.

More Object Oriented Programming papers

See all

Paper text

ie g os bis AN ; HA ei po oo a FER TE, ies ¢ ES a 3 7 IY Oak eo A ote

AL HH ADP 3" Semester Examination 20: Sloane Lae

OE ecm UT ST ee as SS Tae Ss Re a A

== Subject: LT ~ Paper: Object Oriented Programming (CMPC-201)

a EE RAE Cee 8 BE A EE GT a Ee Bt a Bn TRE SD Fo 0517 CST Ti 35 Sr TAT A Rio )

eR Cl Ean (at St Re RE STR SS CR Se RE ER PEN

T° Hwme Allowed: 02:30 Hours ~~ Co Mama DRA: i

~~ Note: Objective part is compulsory. Attempt any three questions from subjective part. =

Ere J - (sR ge ey > BONER) 43s

0 Pe ST Objective Part (Compulsory) Ee HR

Q.1. Write short answers of the following in 2-3 lines each on your answer sheet. Tes) Ca

«i Does Java support Multiple Inheritance. : CR

wi Differentiate between method overloading and method overriding. a

ra Explain the difference between checked and unchecked exceptions. :

sive What is Object Serialization? : ig

¥. What is the purpose of finally() block? EL

: wi A Can a constructor be overloaded? :

: ge an one try block have multiple catch blocks? |

it. Differentiate between component and container. :

Subiective Part

Objective Part (Compulsory)

Write short answers of the following in 2-3 lines each on your answer sheet. ;

0 De Java support Multiple Inheritance. :

wi. _ Differentiate between method overloading and method overriding.

a Explain the difference between checked and unchecked exceptions.

alba is Object Serialization?

What is the purpose of finally() block?

See a constructor be overloaded?

ae one try block have multiple catch blocks?

8% D

ifferentiate between component and container.

Subjective Part

‘2. Define a class BankAccount with fields accountNumber, balance, and accountHolderName. Write

down three-argument constructor. Also, implement Ecibodoi deposit, withdraw, and ol

account details. :

8)

9.3 Write a program to implement an abstract class Shape with two abstract methods area() and

perimeter(). Derive classes Circle (having data member radius) and Rectangle (having data member

length and width) implementing the area() and perimeter() method. In both classes add appropriate

constructors as well. (8)

Area of Circle = PI * (radius)? Perimeter of Circle = 2 * PI * radius

Area of Rectangle = (length*width) Perimeter of Rectangle = 2 (length + width)

Q.4. Explain Exception Handling in Java with an example program handling ArithmeticException and

ArraylndexOutOfBoundsException. ©

Q.5.

a) Explain Aggregation in Java with an example. 5)

7b) What is the significance of the static keyword in Java? :

3)

Q.¢¢ Create a class Rational having fields num and denum. Include two argument constructor, get() and

print() methods. The get() should throw exception if entered dengminator iszero\ Finally, Write ah <

application that uses Rational class. Instantiate two objects and then call get d

for each object. get() and display() a

LK-6562/29-05-25