1Z0-804 · Question #99
Given the Greetings.properties file, containing: What is the result?
The correct answer is A. Compilation fails. The code will not compile. The problem is the following line: System.out.println(resource.getObject(1)); In particular getObject(1) throws the following error: Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type…
Question
Given the Greetings.properties file, containing:
What is the result?
Exhibit
Options
- ACompilation fails
- BHELLO_MSG
- CGOODGYE_NSG
- DHello, everyone!
- EGoodbye everyone!
How the community answered
(57 responses)- A72% (41)
- B9% (5)
- C4% (2)
- D14% (8)
- E2% (1)
Explanation
The code will not compile. The problem is the following line: System.out.println(resource.getObject(1)); In particular getObject(1) throws the following error: Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: <any>.loadResourceBundle Note:getObject(String key) !!! String keyGets an object for the given key from this resource bundle or one of its parents.
Topics
Community Discussion
No community discussion yet for this question.
