java.util.Locale.getLanguage()のサンプル

2019年4月13日

サンプルコード

package com.arkgame;

import java.util.Locale;

public class LocaleDemo {

	public static void main(String[] args) {
	     // create a new locale
	      Locale locale = new Locale("ja", "en", "zh");

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

	      // get language and print it
	      System.out.println("Language:" + locale.getLanguage());
	}

}

結果
Locale:ja_EN_zh
Language:ja

Java

Posted by arkgame