from whizlab ocajp 7 mock
Given:
Which is true?
Select one:
A. The class is fully encapsulated.
B. The code demonstrates polymorphism.
C. The owner variable breaks encapsulation & would eventually affect polymorphism.
D. The simId and talkTime variables break polymorphism.
E. The setSimInfo method breaks encapsulation. Incorrect
The answer is C
But I couldn't understand the statement
Could somebody please explain how lack of encapsulation affects polymorphism ?
Given:
Which is true?
Select one:
A. The class is fully encapsulated.
B. The code demonstrates polymorphism.
C. The owner variable breaks encapsulation & would eventually affect polymorphism.
D. The simId and talkTime variables break polymorphism.
E. The setSimInfo method breaks encapsulation. Incorrect
The answer is C
But I couldn't understand the statement
& would eventually affect polymorphism
Could somebody please explain how lack of encapsulation affects polymorphism ?