Java OCA OCP Practice Question 2584

Question

Which one of the following statements will compile without errors?

  • a) Locale locale1 = new Locale.US;
  • b) Locale locale2 = Locale.US;
  • c) Locale locale3 = new US.Locale();
  • d) Locale locale4 = Locale("US");
  • e) Locale locale5 = new Locale(Locale.US);


b)

Note

The static public final Locale US member in the Locale class is accessed using the expression Locale.US, as in option b).




PreviousNext

Related