Javatpoint Logo
Javatpoint Logo

Java Locale getDefault() method

The getDefault() method of Java Locale class is used to get the current value of the default locale for this instance of the JVM(Java Virtual Mchine).

Syntax

Return

It returns the default locale for this instance of the Java Virtual Machine

Example 1

Test it Now

Output:

Locale:en_US

Example 2

Test it Now

Output:

Locale1: en_US
Locale2: en_US
Next TopicJava Locale



Help Others, Please Share

facebook twitter pinterest