1Z0-804 · Question #93
Which two code blocks correctly initialize a Locale variable?
The correct answer is D. Locale loc4 = Locale.UK; E. Locale loc5 = new Locale("ru", "RU"). D: The Locale class provides a number of convenient constants that you can use to create Locale objects for commonly used locales. For example, the following creates a Locale object for the E: Create a Locale object using the constructors in this class: Locale(String language)…
Question
Which two code blocks correctly initialize a Locale variable?
Options
- ALocale loc1 = "UK";
- BLocale loc2 = Locale.getInstance("ru");
- CLocale loc3 = Locale.getLocaleFactory("RU");
- DLocale loc4 = Locale.UK;
- ELocale loc5 = new Locale("ru", "RU");
How the community answered
(19 responses)- A5% (1)
- B16% (3)
- C5% (1)
- D74% (14)
Explanation
D: The Locale class provides a number of convenient constants that you can use to create Locale objects for commonly used locales. For example, the following creates a Locale object for the E: Create a Locale object using the constructors in this class: Locale(String language) Locale(String language, String country) Locale(String language, String country, String variant)
Topics
Community Discussion
No community discussion yet for this question.