Java学习之获取配置文件中的数据

项目:Springboot

配置文件:test.properties

方法一:

关键工具类:PropertiesLoaderUtils

配置文件内容:

代码:

        Properties properties = PropertiesLoaderUtils.loadAllProperties("test.properties");
        String value = properties.getProperty("test");
        System.out.println("value=" + value);

结果:

value=helloWorld
posted @ 2021-07-14 10:26  请别耽误我写BUG  阅读(190)  评论(0编辑  收藏  举报