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

项目:Springboot

配置文件:test.properties

关键工具类:PropertiesLoaderUtils

配置文件内容:

代码:

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

结果:

value=helloWorld
原文地址:https://www.cnblogs.com/Bernard94/p/15009664.html