美文网首页
Java应用 Properties类的使用方法

Java应用 Properties类的使用方法

作者: Alex_1799 | 来源:发表于2018-06-15 14:28 被阅读0次

1.新建配置类


image.png
image.png

2.使用方法

  //Java配置类 之Properties
        Properties properties=new Properties();
        File file=new File("D:\\pos2g\\src\\hyi\\cream\\autotest\\pro.properties");
        InputStream in=new FileInputStream(file);
        properties.load(in);
        String sf=properties.getProperty("122");
        System.out.println(sf);  //结果为:erer

相关文章

网友评论

      本文标题:Java应用 Properties类的使用方法

      本文链接:https://www.haomeiwen.com/subject/zscmeftx.html