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 :
![]()

[ 0 ] Comments