O'Reilly logo

SCJP: Sun Certified Programmer for Java® Platform, SE6, Study Guide by Richard F. Raposa

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

Assessment Test

  1. The following code appears in a file named Book.java. What is the result of compiling this source file? (Select one answer.)
    1.  public class Book {
    2.      private int pageNumber;
    3.
    4.      private class BookReader {
    5.          public int getPage() {
    6.              return pageNumber;
    7.          }
    8.      }
    9.  }
    1. The code compiles successfully and one bytecode file is generated: Book.class.
    2. The code compiles successfully and two bytecode files are generated: Book.class and BookReader.class.
    3. The code compiles successfully and two bytecode files are generated: Book.class and Book$BookReader.class.
    4. A compiler error occurs on line 4.
    5. A compiler error occurs on line 6.
  2. Given the following TV class:
    1. public class TV { 2. private String make; 3. private String model; ...

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