Hello everyone!
I took my exam today, successfully with 72 %. First of all, I would like to thank Jeanne and Scott for great study guide - thank you. My experience with exam is same as already mentioned here - little time, lot of code to read and poor display resolution of
testing tool - makes it hard to read. You can mark questions to review them at the end, but I didn't have time to do it. I was happy to answer all 50 questions, last three almost without reading. Also Enthuware tests are perfect, almost same questions like in the exam.
I have few questions/erratas about online test bank:
1. Flashcard questions
Which functional interface takes zero parameters and has a get() method?
And on the other side is Consumer. I think it should be Supplier.
Besides itself, which primitive types can be implicitly cast to int?
There is byte and short, what about char?
What are the names of the options available to set a classpath in a java or javac command?
There is -cp, --classpath, and -class-path, but should be --class-path and -classpath.
Also there was question about what commands takes module path and answer was like: "java, javac, jlink, jdeps takes -p or --module-path ..." - but jdeps takes only --module-path, -p means package according to study guide and --help command.
2. Practice exam 3
Which three functional interfaces can fill in the blanks to make the code compile? (Choose three.)
Options:
A. Consumer<Double>
B. DoubleConsumer
C. Function<Long, Double>
D. Function<
String, Double>
E. LongToDoubleFunction
F. ToDoubleFunction<String>
Explanation:
Lines 6 and 7 both call the method applyAsDouble() rather than apply(). This tells us that the answer is a primitive functional interface, ruling out options C and D. The primitive versions are correct with options E and F. Line 8 calls accept(), making it a consumer. Option A is the remaining correct answer.
I was wondering why DoubleConsumer was not correct answer.
3. Book
Answers and explanations, chapter 14, typo in bold:
B, C, E. Options B and C are properties of NIO.2 and are good reasons to use it over the java.io.File class. Option A is incorrect as both APIs can delete only empty directories, not a directory tree. Using a view to read multiple attributes leads to fewer round trips between the process and the file system and better performance, making option E correct. Views can be used to access file system–specific attributes that are not available in Files methods;
therefore, option D is correct. Files is part of NIO.2, whereas File is part of java.io, which means option F is incorrect.
Review questions, chapter 7, question 28:
Finally, Eagle does not compile because it declares an abstract method soar() in a concrete class, making option D correct.
And also missing return type
Thank you so much!
Good luck to others and have nice day.