A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/java/util/locale_getisolanguages.htm below:

Java Locale getISOLanguages() Method

Java Locale getISOLanguages() Method Description

The Java Locale getISOLanguages() method returns a list of all 2-letter language codes defined in ISO 639. Can be used to create Locales.

Declaration

Following is the declaration for java.util.Locale.getISOLanguages() method

public static String[] getISOLanguages()
Parameters

NA

Return Value

This method returns the arrays of language codes.

Exception

NA

Getting Array of ISO Languages from Locale Example

The following example shows the usage of Java Locale getISOLanguages() method. We're printing a list of 2 letter language codes as defined in ISO 3166.

package com.tutorialspoint;

import java.util.Locale;

public class LocaleDemo {
   public static void main(String[] args) {

      // get ISO languages
      String[] languages = Locale.getISOLanguages();

      // print languages
      System.out.println("Languages are:");
      
      for (int i = 0; i < languages.length; i++) {
         System.out.println(i + ":" + languages[i]);
      }
   }
}
Output

Let us compile and run the above program, this will produce the following result −

Languages are:
0:aa
1:ab
2:ae
3:af
4:ak
...
187:zu

java_util_locale.htm


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4