package readFile;
import java.util.Enumeration;
import java.util.ResourceBundle;
public class ReadPropFile
{
public static void main(String[] args)
{
ResourceBundle bundle = ResourceBundle.getBundle("MyProp");
//System.out.println(bundle.toString());
String email = bundle.getString("email");
String password = bundle.getString("password");
System.out.println("Email :: "+email);
System.out.println("Password :: "+password);
// Fetch all the Properties.
Enumeration keys = bundle.getKeys();
while(keys.hasMoreElements()){
System.out.println(keys.nextElement());
}
}
}
MyProp.properties は src フォルダーにある必要があります
MyProp.properties 電子メール = hussain パスワード = hussain