Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 1z0-809 topic 1 question 139 discussion

Actual exam question from Oracle's 1z0-809
Question #: 139
Topic #: 1
[All 1z0-809 Questions]

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?"

  • A. currentLocale = new Locale ("de", "DE");
  • B. currentLocale = new Locale.Builder ().setLanguage ("de").setRegion ("DE").build();
  • C. currentLocale = Locale.GERMAN;
  • D. currentlocale = new Locale(); currentLocale.setLanguage ("de"); currentLocale.setRegion ("DE");
  • E. currentLocale = Locale.getInstance(Locale.GERMAN,Locale.GERMANY);
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
steefaand
2 months, 2 weeks ago
Selected Answer: 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.
upvoted 1 times
...
lchowen
1 year, 7 months ago
Answer is AB. Locale.GERMAN returns Locale("de") only. You need Locale.GERMANY to have Local("de", "DE")
upvoted 2 times
...
WilsonKKerll
2 years, 1 month ago
Answer is AB.
upvoted 3 times
...
AVB22
2 years, 5 months ago
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
upvoted 3 times
...
Eason_from_the_future
2 years, 7 months ago
Locale.GERMANY is new Locale("de", "DE")
upvoted 2 times
...
Eason_from_the_future
2 years, 7 months ago
Locale.GERMAN is new Locale("de")
upvoted 2 times
...
jduarte
3 years ago
Ansewer is A and B. new Locale(); is not valid
upvoted 3 times
...
pul26
3 years, 4 months ago
Answer is AB
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...