Why does using the protected access modifier compromise encapsulation?
A) Multiple classes can set the value of an instance variable defined in another class.
B) When a class does change a protected value, there is added maintenance complexity.
C) Subclass methods that directly set the value of a protected instance variable need to be verified.
D) When high performance is essential, superclass methods can be used to change the value of protected variables.
Correct Answer:
Verified
Q13: Why does Java provide a protected access
Q14: Why would you want to override a
Q15: The extends keyword specifies that the subclass
Q16: If the call to the direct superclass
Q17: When a class extends another class, the
Q19: Typically, an abstract class is a class
Q20: Several classes implement an interface, but all
Q21: The following code will run without errors:
//
Q22: Which of the following is true of
Q23: To use polymorphism, the classes must be
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents