While technically bad form I thought a country code can be lowercase. This example is cited as being bad but legal in the Boyarsky and Selikoff book:
Locale l2 = new Locale.Builder()
.setRegion("us")
.setLanguage("EN")
.build();
About Question enthuware.ocpjp.v8.2.1161 :
Moderator: admin
-
- Posts: 1
- Joined: Wed Feb 28, 2018 12:15 pm
- Contact:
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1161 :
Yes, the book is partially correct. It is correct because lower case values are indeed valid. It is partially correct because Locale class description does not say anywhere that lower case values are bad form. Both are equally acceptable while creating Locale objects.
However, the issue is that some candidates have claimed to get a similar question that asks them to pick correct values for country codes. It seems that the question is asking about the value as returned by Locale's getCountry method, which indeed returns only upper case values.
Paul.
However, the issue is that some candidates have claimed to get a similar question that asks them to pick correct values for country codes. It seems that the question is asking about the value as returned by Locale's getCountry method, which indeed returns only upper case values.
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Google [Bot] and 85 guests