Additional Resources A glossary of key terms from this book and their definitions is available as a fully searchable PDF.
This section includes suggestions and recommendations for how you should prepare for the certification exam. Rather than just reading this book, we recommend writing and executing programs as part of the study process. How you study can be just as important as what you study.
Rome wasn't built in a day, so you shouldn't attempt to study for the exam in only one day. Even if you have been certified with a previous version of Java, the new test includes features and components unique to Java 12–17.
Once you have decided to take the test, you should construct a study plan that fits with your schedule. We recommend that you set aside some amount of time each day, even if it's just a few minutes during lunch, to read or practice for the exam. The idea is to keep your momentum going throughout the exam preparation process. The more consistent you are in how you study, the better prepared you are for the exam. Try to avoid taking a few days or weeks off from studying, or you're likely to spend a lot of time relearning existing material instead of moving on to new material.
Creating and Running the Code
Although some people can learn Java just by reading a textbook, that's not how we recommend that you study for a certification exam. We want you to be writing your own Java sample applications throughout this book so that you don't just learn the material but understand the material as well. For example, it may not be obvious why the following line of code does not compile, but if you try to compile it yourself, the Java compiler tells you the problem:
float value = 102.0; // DOES NOT COMPILE
A lot of people post the question “Why doesn't this code compile?” on the CodeRanch.comforum. If you're stuck or just curious about a behavior in Java, we encourage you to post to the forum. There are a lot of nice people in the Java community standing by to help you.
Throughout this book, we present numerous code snippets and ask you whether they'll compile or not and what their output is. You can place these snippets inside a simple Java application that starts, executes the code, and terminates. You can accomplish this by compiling and running a public
class containing a main()
method and adding the necessary import
statements, such as the following:
// Add any necessary import statements here public class TestClass { public static void main(String[] args){ // Add test code here // Add any print statements here System.out.println("Hello World!");} }
This application isn't particularly interesting—it just outputs Hello World!
and exits. That said, you could insert many of the code snippets presented in this book in the main()
method to determine whether the code compiles, as well as what the code outputs when it does compile.
Real World Scenaria
IDE Software
While studying for an exam, you should develop code using a text editor and command-line Java compiler. Some of you may have prior experience with integrated development environments (IDEs) such as Eclipse, IntelliJ, and Visual Studio Code. An IDE is a software application that facilitates software development for computer programmers. Although such tools are extremely valuable in developing software, they can interfere with your ability to spot problems readily on an exam.
Identifying Your Weakest Link
The review questions in each chapter are designed to help you home in on those features of the Java language where you may be weak and that are required knowledge for the exam. For each chapter, you should note which questions you got wrong, understand why you got them wrong, and study those areas even more. After you've reread the chapter and written lots of code, you can do the review questions again. In fact, you can take the review questions over and over to reinforce your learning, as long as you explain to yourself why each answer is correct.
“Overstudying” the Online Practice Exams
Although we recommend reading this book and writing your own sample applications multiple times, redoing the online practice exams over and over can have a negative impact in the long run. For example, some individuals study the practice exams so much that they end up memorizing the answers. In this scenario, they can easily become overconfident; that is, they can achieve perfect scores on the practice exams but may fail the actual exam.
Applying Test-Taking Strategies
This section includes suggestions you can use when you take the exam. If you're an experienced test taker or you've taken a certification test before, most of this should be common knowledge. For those who are taking the exam for the first time, don't worry! We present a number of practical tips and strategies to help you prepare for the exam.
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.
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:
Читать дальше