资源绑定ResourceBundle

package com.init;

import java.util.ResourceBundle;

public class Resources {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

    }

    public Resources() {
        // TODO Auto-generated constructor stub

        ResourceBundle rb = ResourceBundle.getBundle("aa");
        String username = rb.getString("username");
    }

}

 

posted on 2016-06-21 14:40  ziq711  阅读(143)  评论(0编辑  收藏  举报