Quickly browsing the list answers
Taking the Test 359
Taking the Test
Checking the Answers
To determine whether the code will compile, you should briefl y review the answer choices to see what options are available. If there are no choices of the form “Code does not com-pile,” then you can be reasonably assured all the lines of the code will compile and you do not need to spend time checking syntax. These questions are often, but not always, among the easiest questions because you can skip determining whether the code compiles and instead focus on what it does.
B. Tuesday
C. Friday
key is that those other lines do not throw compiler errors themselves. By quickly browsing the list of answers, you can save time by focusing only on those lines of code that are pos-sible candidates for not compiling.
If you are able to identify a line of code that does not compile, you will be able to fi nish the question a lot quicker. Often, the most diffi cult questions are the ones where the code does in fact compile, but one of the answer choices is “Does not compile” without indicat-ing any line numbers. In these situations, you will have to spend extra time verifying that each and every line compiles. If they are taking too much time, we recommend marking these for “Review” and coming back to them later.
2: protected boolean hasFur() { return false; }
3: }
8: }
9: }