1.

Which of these is a mechanism for naming and visibility control of a class and its content?(a) Object(b) Packages(c) Interfaces(d) None of the Mentioned.This question was addressed to me in an online quiz.I need to ask this question from Packages in section Interfaces & Packages of Java

Answer»

Right option is (b) Packages

Easy explanation: Packages are both naming and visibility control mechanism. We can define a CLASS INSIDE a package which is not accessible by code OUTSIDE the package.



Discussion

No Comment Found

Related InterviewSolutions