About Question enthuware.ocpjp.v8.2.1163 :

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

Moderator: admin

Post Reply
MoistCarrot
Posts: 6
Joined: Fri Oct 26, 2018 9:18 pm
Contact:

About Question enthuware.ocpjp.v8.2.1163 :

Post by MoistCarrot »

The questions states...
(Assume appropriate import statements)
The following explanation is offered for option 2...
In this question, the import statements are not specified. If appropriate imports are present (i.e. import static java.util.Locale.*; ), this will work fine.
Since appropriate import statements are assumed, wouldn't that also make option 2 correct? I believe this may be confusing or misleading.

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

Re: About Question enthuware.ocpjp.v8.2.1163 :

Post by admin »

Yes, that is why the explanation also says the following after the statement that you've quoted:
In the exam, you may see a couple of question that have such ambiguous options. In our opinion, it is best not to assume anything special or out of ordinary. Therefore, this option should not be selected.
The exam does mention that appropriate imports are to be assumed. But assuming static imports? We don't know. Use your discretion.
If you like our products and services, please help us by posting your review here.

noeloo
Posts: 61
Joined: Sat Feb 15, 2020 8:56 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1163 :

Post by noeloo »

Note that once a ResourceBundle is retrieved, changing the Locale will not affect the ResourceBundle.
But can it even be changed later? If yes, in what way?

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

Re: About Question enthuware.ocpjp.v8.2.1163 :

Post by admin »

Yes, you can set the myLoc variable to a different Locale object. Of course, you can't change a Locale object itself because it is immutable.
If you like our products and services, please help us by posting your review here.

noeloo
Posts: 61
Joined: Sat Feb 15, 2020 8:56 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1163 :

Post by noeloo »

Oh gosh, this is so obvious. I'm sorry, but I wouldn't call it "changing the Locale" - like you wrote it's immutable, so as per my understanding you cannot really change it. You can replace the reference, but then you're not changing any locale object..

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

Re: About Question enthuware.ocpjp.v8.2.1163 :

Post by admin »

Hmm...never heard the phrase "replacing a reference" used in a technical discussions. But anyway I think in the context of this question, it is quite clear what the explanation is trying to convey.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 47 guests