Java Magazine, Nov/Dec 2017
Quiz Yourself Intermediate and advanced test questions ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 91 fix this Before entering into my usual preamble about the quiz questions let me share some corrections and refinements The first from Chris Noƫ is that contrary to what I mentioned in the answer for question 3 in the July August issue the newWatchService method in the FileSystem class is not static Hes right it is a factory but its not static its an instance method Another reader Robert Filman noted that in my answer for question 4 of the same issue regarding how compilers might reorder the code I suggested that reordering two particular methods would not change the outcome of the code I had created the methods with no arguments but I failed to state the idea that was in my head which was that the methods should have no side efects If they have side efects my assertion about reordering would be unsound indeed compilers are unlikely to reorder method calls precisely because its too difficult for them to know whether the methods have side efects Compilers typically reorder things they can see in their entirety for example two arithmetic expressions The discussion was intended to be illustrative and its hard at times to strike the right balance between filling in all the details and getting to the point Its possible that you think it takes me too long to get to the point anyway I very much welcome readers to write to me with concerns or questions Everyone gains by sharing in the discussion or correction Email me care of Java Magazine at javamag_ us@ oracle com If youre a regular reader of this quiz you know that these questions simulate the level of dificulty of two diferent certification tests Those marked intermediate correspond to questions from the Oracle Certified Associate exam which contains questions for a preliminary level of certification Questions marked advanced come from the 1Z0 809 Programmer II exam which is the certification test for developers who have been certified at a basic level of Java 8 programming knowledge and now are looking to demonstrate more advanced expertise SIMON ROBERTS
You must have JavaScript enabled to view digital editions.