Appendix F Mock Exam

This is a mock exam for Sun Certified Programmer for the Java Platform Standard Edition 6 (SCJP 1.6). 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.

Questions

Q1 Given the following class, which statements can be inserted at (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;       // (1) INSERT CODE HERE.     }   }

Select the four correct answers.

(a) a++;

(b) b++; ...

Get A Programmer’s Guide to Java™ SCJP Certification: A Comprehensive Primer, Third 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.