nerdexam
Oracle

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…

Localization

Question

Given the Greetings.properties file, containing:

What is the result?

Exhibit

1Z0-804 question #99 exhibit

Options

  • ACompilation fails
  • BHELLO_MSG
  • CGOODGYE_NSG
  • DHello, everyone!
  • EGoodbye everyone!

How the community answered

(57 responses)
  • A
    72% (41)
  • B
    9% (5)
  • C
    4% (2)
  • D
    14% (8)
  • E
    2% (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

#ResourceBundle#properties file#bundle loading#compilation

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice