About Question enthuware.ocpjp.v7.2.1769 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
jagoneye
Posts: 97
Joined: Wed Dec 28, 2016 9:00 am
Contact:

About Question enthuware.ocpjp.v7.2.1769 :

Post by jagoneye »

If default locale is not given in the question then we have to assume that exception will be thrown if no suitable Resource Bundle is found right?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1769 :

Post by admin »

That is correct.

jagoneye
Posts: 97
Joined: Wed Dec 28, 2016 9:00 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1769 :

Post by jagoneye »

Thanks!

FlatPanda
Posts: 8
Joined: Sun Feb 23, 2020 6:51 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1769 :

Post by FlatPanda »

I was surprised by the fact that the Language part can be something else than an Alpha-2 Language code. Would it be beneficial to expand the note with at least a link to the corresponding section of the Javadoc? I am thinking about this paragraph: https://docs.oracle.com/en/java/javase/ ... f_language

Based on this question and the provided explanation one could assume that

Code: Select all

new Locale.Builder().setlanguage("indianenglish").build()
works but that will throw an

Code: Select all

java.util.IllformedLocaleException: Ill-formed language: indianenglish [at index 0]

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1769 :

Post by admin »

You are not required to know or recognize valid language codes for the exam, so, you can assume that the value given for the language parameter is valid.
In this question, the focus is on identifying the properties files that should be available for the given code to work. As the explanation notes, the exception will be thrown because there is no matching properties file available.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests