Java Magazine, Nov/Dec 2016
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2016 67 fix this Once again Ive composed more problems that simulate questions 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 Readers looking for basic instruction should consult the New to Java column which appears in every issue Ed As usual these questions can require careful deduction to obtain the right answer Question 1 Given the following code ResourceBundle properties ResourceBundle getBundle scratch ConfigData Locale FRANCE line n1 System out println properties getString help line n2 And a directory and text file scratch ConfigData properties located on the CLASSPATH of the running program which contains the following text file File edit Edit help Help What is the result Choose one a help b Help c Aide d An exception at line n1 e An exception at line n2 Question 2 Given this code Collection String coll new ArrayList coll add Fred coll add Jim coll add Sheila System out println coll is coll coll remove 0 line n1 System out println coll is coll What is the result Choose one a coll is Fred Jim Sheila coll is Jim Sheila b coll is Fred Jim Sheila coll is Fred Jim Sheila c Compilation fails at line n1 d An exception is thrown at line n1 Question 3 Given that the current working directory of the program is empty and given this code fragment Path p Paths get a b cee line n1 System out println p endsWith Paths get b cee System out println p endsWith Paths get ee What is the result Choose one a true true SIMON ROBERTS Quiz Yourself Would you ever use a finally clause with a try with resources Explore this and other subtle questions from an author of the Java certification tests
You must have JavaScript enabled to view digital editions.