How to determine the access level of the elements of a class?

1

This is a competition issue from Secitec 2018 for the position of computer teacher. I have recourse with respect to this issue because there are no qualifiers, but access modifiers such as: private, protected and public. The reserved word "package" is not an explicit access modifier according to Deitel & Deitel. What alternative, in this case would be correct? Here's the question.

Encapsulation is one of the basic principles used in object-oriented programming, which restricts access to variables and one class. To determine the level of access of elements of a class are used the qualifiers, two of which are characterized below.

(I) It is the most rigid level in which only the own class have access to variables and other methods.

(II) It is the level at which variables and methods can be accessed only by other classes belonging to to the same package.

The qualifiers (I) and (II) are called, respectively:

A) public and package

B) public and protected

C) private and package

D) private and protected

    
asked by anonymous 25.04.2018 / 00:26

1 answer

1

Depending on the interpretation of the examining bank may be alternative C or question overturned. In fact, the term package does not apply to the access modifier, but to the access level (package-protected). The fact of calling the qualifier modifier is subject to the interpretation of the bank, since it is possible to understand one another, although the usual term is modifier.

    
25.04.2018 / 00:53