Locale.getDefault() has the following syntax.
public static Locale getDefault()
In the following code shows how to use Locale.getDefault() method.
//from ww w .j ava2 s .co m import java.util.Locale; public class Main { public static void main(String[] args) { Locale locale = Locale.getDefault(); // print the default locale System.out.println("Locale:" + locale); } }
The code above generates the following result.