Java Locale getDefault() Example

Locale class getDefault() method example. This example shows you how to use getDefault() method.


Syntax is : public public static Locale getDefault()
Method returns the current value of the default locale for this instance of the Java Virtual Machine. It can be changed using the setDefault()
method.

Here is the code.

/**
 * @(#) GetDefaultLocale.java
 * A class representing use of method getDefault() of Locale class
 in java.util Package.
 * @Version  24-May-2008
 @author   Rose India Team
 */
import java.util.*;

class GetDefaultLocale {
    public static void mainString args[] ){

      // getDefault() method call. This is static method.
        Locale locale = Locale.getDefault();
        System.out.println("current value of the default locale : " + locale);
  }
}

Output of the program.
current value of the default locale : en_US

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US