Some more issues not mentioned on https://www.selikoff.net/ocp11-2/
from Java OCP 11 Programmer II Study Guide:
page 469, question 11: the questions mentions execution deleteTree("/storage")
. This should be deleteTree(new File("/storage"))
page 473, question 22: ...created on line 15 => ...created on line 17
page 491, the tip: On the exam, when you see Files.resolve()
page 511, Walking a Directory with walk(), first sentence: Steam API => Stream API
page 514, table 9.6: nest.gif => wings.gif
page 525, question 18: the questions asks about possible results. If the directory consists solely of .java files, all files are printed. B is a possible answer.
page 607, question 7: stmt.executeQuery(sql)
is called on a PreparedStatement. Since sql contains a bind variable, a SQLException is thrown. This still makes the correct answer F, but since the explanation did not mention throwing an exception, I guess the code should be stmt.executeQuery()
page 608, question 12, answer says whitelist, but should be blacklist? : The code checks a condition. If the condition is true, an exception is thrown to block the protected code. This seems the recipe for Blacklist, not for Whitelist (which checks on a condition to be true and only if so runs the protected code)
Those two sentences don't actually contradict each other.
They do not contradict, but the reasoning is not in line with eachother, which could be confusing.