Ask Question

Which of the following is true about protected access?

A. Protected members may be accessed by methods in the same package or in a subclass, even when the subclass is in a different package.

B. Protected members are actually named constants.

C. Protected members may be accessed by methods in the same package or in a subclass, but only if the subclass is in the same package.

D. Protected members cannot be accessed by methods in any other classes.

+3
Answers (1)
  1. 21 November, 08:37
    0
    Answer: (A) Protected members may be accessed by methods in the same package or in a subclass, even when the subclass is in a different package.

    Explanation:

    Methods, constructors and variables, that are protected in superclass they can be only accessed by any class within the package of the protected members class and methods in the same package or they can be of a subclass or the subclasses that may be present in other package.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following is true about protected access? A. Protected members may be accessed by methods in the same package or in a ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers