Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 139

Given the content:

and given the code fragment:

Which two code fragments, when inserted at line 1 independently, enable the code to print "Wie geht's?"

    Correct Answer: B, D

Discussion
WilsonKKerllOptions: AB

Answer is AB.

AVB22Options: AB

AB tested Locale currentLocale = new Locale ("de", "DE"); System.out.println(currentLocale); currentLocale = new Locale.Builder ().setLanguage ("de").setRegion ("DE").build(); System.out.println(currentLocale); currentLocale = Locale.GERMAN; System.out.println(currentLocale); output: de_DE de_DE de

jduarteOptions: AB

Ansewer is A and B. new Locale(); is not valid

lchowenOptions: AB

Answer is AB. Locale.GERMAN returns Locale("de") only. You need Locale.GERMANY to have Local("de", "DE")

Eason_from_the_futureOptions: AB

Locale.GERMANY is new Locale("de", "DE")

Eason_from_the_futureOptions: AC

Locale.GERMAN is new Locale("de")

steefaandOptions: AB

A and B are correct. C gives de only, D doesn't compile since Locale doesn't have no-arg constructor and setters (that's Locale.Builder) and E doesn't compile since there is no getInstance method defined on Locale.

pul26Options: AB

Answer is AB