1.

Which of the following modifier means a particular variable cannot be accessed within the package?(a) private(b) public(c) protected(d) defaultI had been asked this question in unit test.I'm obligated to ask this question of Access Control topic in chapter Classes and Methods of Java

Answer»

The correct CHOICE is (a) PRIVATE

Explanation: Private variables are accessible only WITHIN the CLASS.



Discussion

No Comment Found

Related InterviewSolutions