By GokiSoft.com|
10:25 21/09/2021|
Java Advanced
[Share Code] Tìm hiểu đa ngôn ngữ - lập trình Java - C2009G
#globals_en_US.properties
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
option_input = 1. Input student
option_display = 2. Display student
option_exit = 3. Exit
option = Choose:
#globals.properties
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
option_input = 1. Nhap thong tin sinh vien
option_display = 2. Hien thi danh sach sinh vien
option_exit = 3. Thoat
option = Chon:
#Main.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lesson09;
import java.util.Locale;
import java.util.ResourceBundle;
/**
*
* @author Diep.Tran
*/
public class Main {
public static void main(String[] args) {
showMenu();
}
static void showMenu() {
Locale locale = new Locale("en", "US");
ResourceBundle bundle = ResourceBundle.getBundle("lesson09.globals", locale);
System.out.println(bundle.getString("option_input"));
System.out.println(bundle.getString("option_display"));
System.out.println(bundle.getString("option_exit"));
System.out.println(bundle.getString("option"));
}
}
Tags:
Phản hồi từ học viên
5
(Dựa trên đánh giá ngày hôm nay)