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

Object Oriented Programming Msc IT 2 Semester/Term University Of Sargodha (UOS) 2016

Object Oriented Programming Msc IT 2 Semester/Term University Of Sargodha (UOS) 2016 — 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

University of Sargodha

M.Se, 2id Term Exam 2016.

Paper: Object Oriented Programming (CMP: 2123)

Maximum Maria: 60

ustadni.com

Sublect: L.I

Allowed: 2:30 Hour

Note:

ustadni.com

(2*12)

Objective Part

(Compulsory)

0.1.

i.

ii.

Hi.

iv.

V.

vi.

vili.

ix.

X.

xi.

xii.

Attempt all questions each question carry equal marks?

What do you mean by object oriented programming?

How we create a reference variable and object of a class?

What do you mean by encapsulation in object oriented programming?

How we concatenate two strings?

What is the purpose of Scanner class?

What is the purpose of constructor of a class?

Differentiate abstract classes and concrete classes?

Differentiate between Upcasting and Downcasting

What is overriding of a method? Also give an example.

What is IS-A relationship in classes?

Can we extend an Interface in a class?

What is dynamic polymorphism?

Subjective Part

(4*9)

Q.2

Create a Distance class with instance variable feet and inches. Write suitable parameterized

constructor, getter and setter methods and a method to add two distance objects in such a way

that if resultant inches exceed 12, feet should be incremented by 1 and inches decremented by

12 by using the statementdist3 - distl.add(dist2); where disti, dist2 and dist3 are objects of

Distance class.

0.3.

Create a Shape interface that uses Area as method. Two classes Rectangle and Circle, use

Shapeintarface, implement the concept of Upcasting by calculating the areas of implementing

clabies:

e-ustente a Person class that uses name pocktance variable. Create another class Student

extending Person class that uses student Id as variable of Student class. Writa suitable

parameterized constructor only gad implement concept of overriding to display Pinformation

within the object.

Describe the concept of polymorphism by highlighting its different types by using suitable

examples.

Q.6.

How exception handling is used to avoid abnormal termination. Give three examples of un-

0.7.

checked exceptions by giving examples.

What are different types of variables supported by java? What are the various ways to initialize

each of them?

visit website: ustadni.com