Читать книгу OCP Oracle Certified Professional Java SE 17 Developer Study Guide - Jeanne Boyarsky - Страница 39

Using the Provided Writing Material

Оглавление

Depending on your particular testing center, you may be provided with a sheet of blank paper or a whiteboard to use to help you answer questions. In our experience, a whiteboard with a marker and an eraser are more commonly handed out. If you sit down and you are not provided with anything, make sure to ask for such materials. If you aren't given an eraser, feel free to ask for a second whiteboard page.

After first checking whether the code compiles, it is time to understand what the program does! One of the most useful applications of writing material is tracking the state of primitive and reference variables. For example, let's say you encountered the following code snippet on a question about garbage collection:

Object o = new Turtle(); Mammal m = new Monkey(); Animal a = new Rabbit(); o = m;

In a situation like this, it can be helpful to draw a diagram of the current state of the variable references. As each reference variable changes which object it points to, you erase or cross out the arrow between them and draw a new one to a different object.

Using the writing material to track state is also useful for complex questions that involve a loop, especially questions with embedded loops. For example, the value of a variable might change five or more times during a loop execution. You should make use of the provided writing material to improve your score.

While you cannot bring any outside material into an exam, you can write down material at the start of the exam. For example, if you have trouble remembering which functional interfaces take which generic arguments, it might be helpful to draw a table at the start of the exam on the provided writing material. You can then use this information to answer multiple questions.

OCP Oracle Certified Professional Java SE 17 Developer Study Guide

Подняться наверх