Ask Question
11 August, 13:53

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.

+1
Answers (1)
  1. 11 August, 16:58
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers