Self-Review Exercise

8.1Fill in the blanks in each of the following statements:
  1. When compiling a class in a package, the javac command-line option _____ specifies where to store the package and causes the compiler to create the package’s directories if they do not exist.

  2. String class static method _____ is similar to method System.out.printf, but returns a formatted String rather than displaying a String in a command window.

  3. If a method contains a local variable with the same name as one of its class’s fields, the local variable _____ the field in that method’s scope.

  4. The _____ method is called by the garbage collector just before it reclaims an object’s memory.

  5. A(n) _____ declaration specifies one class to import.

  6. If a class declares constructors, ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.