「Java」java.util.Properties.getProperty() の使い方

javaコード
package itstudy;

import java.util.Properties;

public class PropertiesDemo {

public static void main(String[] args) {
Properties prop = new Properties();

// add some properties
prop.put(“City", “tokyo");
prop.put(“Name", “山田");
prop.put(“Age", “31");

// get two properties and print them
System.out.println(“" + prop.getProperty(“Age","44″));
System.out.println(“" + prop.getProperty(“Name","杉浦"));

}
}
実行結果
31
山田

Java

Posted by arkgame