Jeanne Boyarsky wrote:
You are correct it would should have had the import there. But it isn't an errata because we got lucky! After this book went to print, Oracle added verbiage to all their exams saying imports may or may not be provided. So a missing import is now implied on the exam.
I don't think that is the right interpretation of Oracle's assumption. You can assuming missing imports if there are no import statements. You cannot assume the existence of one missing import when the code listing contains import statements. Here is what they've specified:
If sample code do not include package or import statements, and the question does not explicitly refer to these missing statements, then assume that all sample code is in the same package, or import statements exist to support them.
Assuming the existence of one import statement when other import statements are present is bad advice. Specially when one of the options is "will not compile".
HTH,
Paul.