Assume a class is visible to the general public. We define a protected method in this class. Which one of the following statements is true?
A. This method is only accessible from within the class and all of its subclasses.
B. You cannot specify methods in a class that have a lower visibility than the visibility of the class in which it is declared.
C. You cannot access public methods from within protected methods.
D. This function is available from within the class as well as from any classes declared in the same package as the class.
Answer:D
Assume a class is visible to the general public. We define a protected method in this class. Which one of the following statements is true?
A. This method is only accessible from within the class and all of its subclasses. B. You cannot specify methods in a class that have a lower visibility than the visibility of the class in which it is declared. C. You cannot access public methods from within protected methods. D. This function is available from within the class as well as from any classes declared in the same package as the class.
Explanation: This technique can be accessed from within