1.

Which among the following can use protected access specifier?(a) Members which may be used in other packages(b) Members which have to be secure and should be used by other packages/subclass(c) Members which have to be accessed from anywhere in the program(d) Members which have to be as secure as private but can be used by main() functionI got this question in class test.This interesting question is from Protected Access Specifier in division Access Specifiers of Object Oriented Programming

Answer»

Right answer is (b) Members which have to be SECURE and should be USED by other packages/subclass

Explanation: The members which have to be secure and might GET used in other packages or subclasses can use protected access. This ALSO allows the members to be SAFE from accidental modification.



Discussion

No Comment Found

Related InterviewSolutions