1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Localeオブジェクトの取得

Posted at

#Localeとは
 国や言語で分けた「地域」を表す情報のこと。ロケールは__java.util.Locale__クラスのオブジェクトで表す。

#Localeオブジェクトの取得 その1

Myclass.java
Locale loc = new Locale("ja"); //ja
Locale loc = new Locale("en","US"); //en_US
Locale loc = new Locale("fr","CA","POSIX"); //fr_CA_POSIX

#Localeオブジェクトの取得 その2

Myclass.java
Local loc = new Locale.Builder().setLanguage("ja").setRegion("JP").build();
//ja_JP

#まとめ
ロケールオブジェクトの取得に関して、上記2パターンあることを頭に置いておくべし。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?