java.util.Properties.getProperty()方法实例

来源:互联网 发布:联胜软件 编辑:程序博客网 时间:2024/05/21 11:23

此方法获得指定属性列表中的指定键的属性值。

import java.util.*;public class PropertiesDemo {   public static void main(String[] args) {      Properties prop = new Properties();      // add some properties      prop.put("Height", "200");      prop.put("Width", "150");      prop.put("Scannable", "true");      // get two properties and print them      System.out.println("" + prop.getProperty("Scannable"));      System.out.println("" + prop.getProperty("Width"));   }}
0 0
原创粉丝点击