admin wrote:Congratulations on passing and thank you for your feedback about Locale.Builder. We do have a few questions that make use of this class but they are in Java 8 upgrade question bank.
Did the questions that you got require detailed knowledge (i.e. methods of this class and what they do) of Locale.Builder? Or was this class used only in the problem statement, something like this?
...
thank you,
Paul.
Hi Paul - and thank you.
The question seemed to be testing string switching, rather than Locale. It iterated through an array of Strings, manipulated each a little and switching on the results. Each case built a Locale, one of them much like what you gave, another was similar but in two stages, and the third used 'forLanguageTag'. At the end, the Locales were used to print country info.
I was vaguely aware of the builders, but had never seen 'forLanguageTag', so I had to take a leap of faith and assume that 'compilation fails' wasn't the answer due to that. Seems I was right, as Locales wasn't listed on the things I got wrong
Anyway thanks again for the sample exams. Definitely helped me get through!