Ask Question

Which of this access specifies can be used for a class so that its members can be accessed by a different class in the same package?

a) Public

b) Protected

c) No Modifier

d) All of the mentioned

+4
Answers (1)
  1. 6 March, 20:43
    0
    D) All the mentioned

    Explanation:

    public: This access modifier allows access from all classes in the program

    protected: Means only classes within the same package or sub-classes (inheritance) can access members of the class

    No Modifier: Omiting the modifier sets a class to the default. Which implies only classes in the same package can access members of the class.

    The given question refers to class members in the same package so any these three access modifiers can be used.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of this access specifies can be used for a class so that its members can be accessed by a different class in the same package? 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