0% found this document useful (0 votes)
283 views3 pages

Oops

Class C inherits attributes from both class A and B. Class D inherits attributes from both class A and B through its parent class C. Encapsulation hides an object's implementation details and exposes only interfaces to other objects. Polymorphism allows objects to respond differently to the same message. Inheritance represents an "is-a" relationship between classes in an inheritance hierarchy.
Copyright
© Attribution Non-Commercial (BY-NC)
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)
283 views3 pages

Oops

Class C inherits attributes from both class A and B. Class D inherits attributes from both class A and B through its parent class C. Encapsulation hides an object's implementation details and exposes only interfaces to other objects. Polymorphism allows objects to respond differently to the same message. Inheritance represents an "is-a" relationship between classes in an inheritance hierarchy.
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 3

Sample Test Paper For OOC

1. Class C is inherited from class A and class B,class D is inherited from class C.
Which of the following is true
I] class C inherits class A attributes
II] class C inherits class B attributes
III] class D inherits class B attributes only
IV] class D inherits class A attributes only

a) I, II
b) I,II,III,IV
c) II,III
d) I, IV

2. Encapsulation is a principle

a) which allows any object to derive and reuse the characteristics of another object.
b) which facilates the object to hide its implementaion and expose only the interfaces
c) which allows any object to expose only the objects attributes
d) which makes any object to behave differenlt depending upon the input object or the
calling object.

3. Which of the following is true?

a) In a procedural language, data and functions are loosely coupled where they are
tightly coupled in case of OO languages.
b) In a OO, data and functions are loosely coupled where they are tightly coupled in case
of procedural languages.
c) data and function cannot be coupled.
d) none of the above

4. State true or false


Encapsulation hides Abstraction.

a) true
b) false
c) Ignore this option
d) Ignore this option
5. Which of the following statement/s are true?
i] Encapsulation is hiding the implementation details and revealing a
consistent interface.
ii] Abstraction is hiding the implementation details and revealing a
consistent interface.
iii] Inheritance represents "is a kind of" relationship

iv] Polymorphism allows two or more objects to respond to the same message
in a different way.

a) i], iii] & iv]


b) ii], iii] & iv]
c) i] ,ii], iii] & iv]
d) iii] & iv]

6) The relationship between seed,seedling,plant & tree

a.polymorphism
b.container class
c.inheritance
d.none of the above

7. Car turning left on a road. & same car turning right on the same road.

a.overloading
b.overriding
c.inheritance
d.none

8. _____________ allows a sending object to communicate with different objects in


a consistent manner without worrying about the different implimentations available
for the message.
i) Inheritence
ii) Dynamic binding
iii) Polymorphism
iv) Encapsulation

9. Encapsulation is a principle

a) which allows any object to derive and reuse the characteristics of another object.
b) which facilates the object to hide its implementaion and expose only the interfaces
c) which allows any object to expose only the objects attributes
d) which makes any object to behave differenlt depending upon the input object or the
calling object.
10. A class that inherits from more than one superclass can also be defined. This is
called

a) multiple inheritance
b) multilevel inheritance
c) either a and b
d) none of the above

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy