getDefault() method example

getDefault() method example


Posted in : Java Posted on : November 23, 2011 at 7:12 PM Comments : [ 0 ]

In this tutorial you will learn how to use getDefault() method in java.

getDefault() method example

In this tutorial you will learn how to use getDefault() method in java.

getDefault() is a method of Locale class that finds your current default locale.

syntax :

public final String getDefault();

Example :

package devmanuals.com;
import java.util.Locale;
public class GetDefault
{
public static void main(String args[])
{
Locale loc= Locale.getDefault();
System.out.println("Your current default locale is :");
System.out.println(loc);
}
}

Output :

When you will execute the above example you will get the output as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics