Taking the Assessment Test

Use the following assessment test to gauge your current level of skill in Java. This test is designed to highlight some topics for your strengths and weaknesses so that you know which chapters you might want to read multiple times. Even if you do well on the assessment test, you should still read the book from cover to cover, as the real exam is quite challenging.

The Assessment Test

  1. What is the result of the following program?

    • 1: public class MathFunctions {
    • 2: public static void addToInt(int x, int amountToAdd) {
    • 3: x = x + amountToAdd;
    • 4: }
    • 5: public static void main(String[] args) {
    • 6: var a = 15;
    • 7: var b = 10;
    • 8: MathFunctions.addToInt(a, b);
    • 9: System.out.println(a); } }
    1. 10
    2. 15
    3. 25
    4. Compiler error on ...

Get OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide 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.