java 方法 示例
区域设置类getISOLanguages()方法 (Locale Class getISOLanguages() method)
getISOLanguages() method is available in java.util package.
getISOLanguages()方法在java.util包中可用。
getISOLanguages() method is used to return an array of string that holds two-letter available language codes in ISO 639.
getISOLanguages()方法用于返回一个字符串数组,该字符串数组包含ISO 639中两个字母的可用语言代码。
getISOLanguages() method is a static method, it is accessible with the class name and if we try to access the method with the class object then we will not get an error.
getISOLanguages()方法是一个静态方法,可以使用类名称进行访问,如果尝试使用类对象访问该方法,则不会收到错误。
getISOLanguages() method does not throw an exception at the time of returning the array of the string of language codes.
返回语言代码字符串数组时, getISOLanguages()方法不会引发异常。
Syntax:
句法:
public static String[] getISOLanguages();
Parameter(s):
参数:
It does not accept any parameter.
它不接受任何参数。
Return value:
返回值:
The return type of the method is String[], it returns list of all two letter language codes that exists in ISO 639.
该方法的返回类型为String [] ,它返回ISO 639中存在的所有两个字母语言代码的列表。
Example:
例:
// Java program to demonstrate the example
// of String[] getISOLanguages() method of Locale
import java.util.*;
public class GetISOLanguagesOfLocale {
public static void main(String[] args) {
// Instantiates Locale
Locale lo = new Locale("JAPANESE", "JAPAN");
// Display Locale
System.out.println("lo: " + lo);
// By using getISOLanguages() method is
// to return all 2 letter ISO 3166 codes
// for the locale languages
String[] lang = lo.getISOLanguages();
System.out.println("lo.getISOLanguages(): ");
for (int i = 0; i < lang.length; ++i)
System.out.println(lang[i]);
}
}
Output
输出量
lo: japanese_JAPAN
lo.getISOLanguages():
aa
ab
ae
af
ak
am
an
ar
as
av
ay
az
ba
be
bg
bh
bi
bm
bn
bo
br
bs
ca
ce
ch
co
cr
cs
cu
cv
cy
da
de
dv
dz
ee
el
en
eo
es
et
eu
fa
ff
fi
fj
fo
fr
fy
ga
gd
gl
gn
gu
gv
ha
he
hi
ho
hr
ht
hu
hy
hz
ia
id
ie
ig
ii
ik
in
io
is
it
iu
iw
ja
ji
jv
ka
kg
ki
kj
kk
kl
km
kn
ko
kr
ks
ku
kv
kw
ky
la
lb
lg
li
ln
lo
lt
lu
lv
mg
mh
mi
mk
ml
mn
mo
mr
ms
mt
my
na
nb
nd
ne
ng
nl
nn
no
nr
nv
ny
oc
oj
om
or
os
pa
pi
pl
ps
pt
qu
rm
rn
ro
ru
rw
sa
sc
sd
se
sg
si
sk
sl
sm
sn
so
sq
sr
ss
st
su
sv
sw
ta
te
tg
th
ti
tk
tl
tn
to
tr
ts
tt
tw
ty
ug
uk
ur
uz
ve
vi
vo
wa
wo
xh
yi
yo
za
zh
zu
翻译自: https://www.includehelp.com/java/locale-getisolanguages-method-with-example.aspx
java 方法 示例