OCP Oracle Certified Professional Java SE 17 Developer Study Guide. Jeanne Boyarsky
Читать онлайн книгу.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.
Understanding the Question
The majority of questions on the exam contain code snippets and ask you to answer questions about them. For those items containing code snippets, the number-one question we recommend that you answer before attempting to solve the question is this:
Does the code compile?
It sounds simple, but many people dive into answering the question without checking whether the code actually compiles. If you can determine whether a particular set of code compiles and what line or lines cause it to not compile, answering the question often becomes easy.
Applying the Process of Elimination
Although you might not immediately know the correct answer to a question, if you can reduce the question from five answers to three, your odds of guessing the correct answer are markedly improved. Moreover, if you can reduce a question from four answers to two, you'll double your chances of guessing the correct answer!
In some cases, you may be able to eliminate answer choices without even reading the question. If you come across such questions on the exam, consider it a gift. Can you correctly answer the following question in which the application code has been left out?
1 Which line, when inserted independently at line m1, allows the code to compile?- Code Omitted -public abstract final int swim();public abstract void swim();public abstract swim();public abstract void swim() {}public void swim() {}
Without reading the code or knowing what line m1
is, we can eliminate three of the five answer choices. Options A, C, and D contain invalid declarations, leaving us with options B and E as the only possible correct answers.
Skipping Difficult Questions
The exam software includes an option to “mark” a question and review all marked questions at the end of the exam. If you are pressed for time, answer a question as best you can and then mark it to come back to later.
All questions are weighted equally, so spending 10 minutes answering five questions correctly is a lot better use of your time than spending 10 minutes on a single question. If you finish the exam early, you have the option of reviewing the marked questions as well as all of the questions on the exam, if you choose.
Being Suspicious of Strong Words
Many questions on the exam include answer choices with descriptive sentences rather than lines of code. When you see such questions, be wary of any answer choice that includes strong words such as “must,” “all,” or “cannot.” If you think about the complexities of programming languages, it is rare for a rule to have no exceptions or special cases. Therefore, if you are stuck between two answers and one of them uses “must” while the other uses “can” or “may,” you are better off picking the one with the weaker word since it is a more ambiguous statement.
Choosing the Best Answer
Sometimes you read a question and immediately spot a compiler error that tells you exactly what the question is asking. Other times, though, you may stare at a method declaration for a couple of minutes and have no idea what the answer is. Unlike some other standardized tests, there's no penalty for answering a question incorrectly versus leaving it blank. If you're nearly out of time or you just can't decide on an answer, select a random option and move on. If you've been able to eliminate even one answer choice, then your guess is better than blind luck.
Answer All Questions!
You should set a hard stop at five minutes of time remaining on the exam to ensure that you've answered each and every question. Remember, if you fail to answer a question, you'll definitely get it wrong and lose points; but if you guess, there's at least a chance that you'll be correct. There's no harm in guessing!
When in doubt, we generally recommend picking a random answer that includes “Does not compile” if available, although which choice you select is not nearly as important as making sure that you do not leave any questions unanswered on the exam!
Getting a Good Night's Rest
Although a lot of people are inclined to cram as much material as they can in the hours leading up to an exam, most studies have shown that this is a poor test-taking strategy. The best thing we can recommend that you do before taking an exam is to get a good night's rest!
Given the length of the exam and the number of questions, the exam can be quite draining, especially if this is your first time taking a certification exam. You might come in expecting to be done 30 minutes early, only to discover that you are only a quarter of the way through the exam with half the time remaining. At some point, you may begin to panic, and it is in these moments that these test-taking skills are most important. Just remember to take a deep breath, stay calm, eliminate as many wrong answers as you can, and make sure to answer every question. It is for stressful moments like these that being well rested with a good night's sleep is most beneficial!
Taking the Exam
So you've decided to take the exam? We hope so, if you've bought this book! In this section, we discuss the process of scheduling and taking the exam, along with various options for each.
Scheduling the Exam
The exam is administered by Pearson VUE and can be taken at any Pearson VUE testing center. To find a testing center or register for the exam, go to:
certview.oracle.com
Next, choose Manage Exam at Pearson | VUE. If you have any trouble navigating the website, see our tips at
www.selikoff.net/exam-signup
If