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

7.6 Which statement is true?

Select the one correct answer.

  1. Non-static member classes must have either default or public accessibility.

  2. All nested classes can declare static member classes.

  3. Methods in all nested classes can be declared static.

  4. All nested classes can be declared static.

  5. Static member classes can contain non-static methods.

7.7 Given the declaration
interface IntHolder { int getInt(); }

which of the following methods are valid?

 //----(1)---- IntHolder makeIntHolder(int i) { return new IntHolder() { public int getInt() { return i; } }; } //----(2)---- IntHolder makeIntHolder(final int i) { return new IntHolder { public ...

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