locale in Java

Oracle defines a locale as “a specific geographical, political, or cultural region” .
The format of a locale is, first comes the lowercase language code, then comes an underscore followed by the uppercase country code. The underscore and country code are optional. It is valid for a Locale to be only a language.
There are different ways of creating a Locale. 
* The Locale class provides constants for some of the most commonly used locales,
* Creating a Locale with constructors by passing just a language
* Creating a Locale with constructors by passing both a language and country
* There’s another way to create a Locale that is more flexible. The builder design pattern lets you set all of the properties that you care about and then build it at the end. This means that you can specify the properties in any order.

```
import java.util.Locale;

public class Main {
    public static void main(String[] args) {
        System.out.println(Locale.getDefault()); // en_US
        System.out.println(Locale.GERMAN); // de
        System.out.println(Locale.GERMANY); // de_DE
        System.out.println(new Locale("fr")); // fr
        System.out.println(new Locale("fr", "Fr")); // fr_FR
        System.out.println(new Locale.Builder()
                .setLanguage("en")
                .setRegion("US")
                .build());  // en_US
    }
}
```
When testing a program, you might need to use a Locale other than the default for your computer. You can set a new default right in Java.