Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Java get System Locale

 
 

Share on Google+Share on Google+

Java get System Locale

Advertisement
Java get System Locale

Java get System Locale

     

In this section, you will learn how to obtain the locale. We are providing you an example which will obtain the locale of the system by using the System.getProperty(). This will provide all the properties of the system.

System.getProperty("user.language")- This will return the locale of the system.

Here is the code of GetSystemLocale.java

class  GetSystemLocale
{
  public static void main(String[] args) 
  {
  String locale = System.getProperty("user.language");
  System.out.println("The Locale of the system is: "+locale);
  }
}

Output will be displayed as:

Download Source Code

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 17, 2011

Related Tutorials

Discuss: Java get System Locale  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com