Java SE 8 Programmer II — Question 18

Which two code blocks correctly initialize a Locale variable?

Answer options

Correct answer: D, E

Explanation

Option D is correct because it directly references a predefined Locale object for the UK. Option E is also valid as it correctly initializes a new Locale object with the specified language and country. Options A, B, and C are incorrect due to improper initialization methods or calls that do not conform to the Locale class usage.