O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Review Questions

4.20 Which statements are true about the use of modifiers?

Select the two correct answers.

  1. If no accessibility modifier (public, protected, and private) is specified for a member declaration, the member is only accessible for classes in the package of its class and subclasses of its class anywhere.

  2. You cannot specify accessibility of local variables. They are only accessible within the block in which they are declared.

  3. Subclasses of a class must reside in the same package as the class they extend.

  4. Local variables can be declared static.

  5. Objects themselves do not have any accessibility modifiers, only the object references do.

4.21

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required