Java.util.Locale.getISO3Language() Method



Description

The java.util.Locale.getISO3Language() method returns a three-letter abbreviation for this locale's language. If the locale doesn't specify a language, this will be the empty string. Otherwise, this will be a lowercase ISO 639-2/T language code.

Declaration

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

public String getISO3Language()

Parameters

NA

Return Value

This method does not return a value.

Exception

MissingResourceException − Throws MissingResourceException if the three-letter language abbreviation is not available for this locale.

Example

The following example shows the usage of java.util.Locale.getISO3Language() method.

package com.tutorialspoint;

import java.util.*;

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

      // create a new locale
      Locale locale = new Locale("en", "US", "WIN");

      // print locale
      System.out.println("Locale:" + locale);

      // print ISO3 language name for locale
      System.out.println("Name:" + locale.getISO3Language());
   }
}

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

Locale:en_US_WIN
Name:eng
java_util_locale.htm
Advertisements