Appendix E. Mock Exam: Java SE 8 Programmer I

This is a mock exam for the Java SE 8 Programmer I exam. 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 you a good indication of how well you are prepared for the real exam, and whether any topics need further study. Annotated answers to the questions can be found in Appendix F.

Questions

Q1 Which expression statements, when inserted at (1), will cause the following class to compile without errors?

public class Q6db8 {  private int a;  private int b = 0;  private static int c;  public void m() {    int d;    int e = 0;    // (1) INSERT CODE HERE.  }}

Select the four correct answers.

(a) a++;

(b) b++; ...

Get A Programmer’s Guide to Java® SE 8 Oracle Certified Associate (OCA) 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.