Oracle Certified Professional Java Se 8 Programmer · Free Practice Question Easy
Question 35
Which of the following code will create/return a Locale object for the JVM, on which your code is running?
-
A
System.getDefault(); -
B
Locale.getDefaultLocale(); -
C
Locale.getDefault(); -
D
Locale.getLocale();
Reveal correct answer
Correct answer: C
Explanation
Locale.getDefault(); returns the default Locale for the currently running instance of JVM and getDefault() method is from Locale class and not from System class.Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
