Getting the language of the current locale in Java

Main.java:

import java.util.*;
 
public class Main {
   public static void main(String []args) {
      // for default locale 
      Locale locale = Locale.getDefault();
      System.out.println(locale);  
      System.out.println("Language          " + locale.getLanguage());
      System.out.println("DisplayLanguage   " + locale.getDisplayLanguage());
 
      // for specific locale
      locale = new Locale("nl", "BE");
      System.out.println(locale);  
      System.out.println("Language          " + locale.getLanguage());
      System.out.println("DisplayLanguage   " + locale.getDisplayLanguage());
   }
}

outputs:

en_US
Language          en
DisplayLanguage   English
nl_BE
Language          nl
DisplayLanguage   Dutch