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

Appendix F. Mock Exam

This is a mock exam for the Sun Certified Programmer for the Java 2 Platform (SCPJ2 1.4). It comprises brand new questions, which are similar to the questions that can be expected on the real exam. Working through this exam will give the reader a good indication of how well she is prepared for the real exam, and whether any topics need further study.

Q1 Given the following class, which statements can be inserted at position 1 without causing a compilation error?
public class Q6db8 {
    int a;
    int b = 0;
    static int c;

    public void m() {
        int d;
        int e = 0;

        // Position 1
    }
}

Select the four correct answers.

  1. a++;

  2. b++;

  3. c++;

  4. d++;

  5. e++;

Q2 Which statements are true about the effect of the >> and >>> operators?

Select the three correct answers. ...

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