2、想要使用import导入模块中的函数,必须以模块名+,+函数名的形式调用函数,而想要使用from导入模块中的某个函数,可以直接使用函数名调用。JAVA中没有函数名的函数这样可以重新加载。
* Spring 提供的 PropertiesLoaderUtils 允许您直接通过基于类路径的文件地址加载属性资源
* 最大的好处就是:实时加载配置文件,修改后立即生效,不必重启
*/
private static void springUtil(){
Properties props = new Properties()
while(true){
try {
props=PropertiesLoaderUtils.loadAllProperties("message.properties")
for(Object key:props.keySet()){
System.out.print(key+":")
System.out.println(props.get(key))
}
} catch (IOException e) {
System.out.println(e.getMessage())
}
try {
Thread.sleep(5000)
} catch (InterruptedException e) {
e.printStackTrace()
}
}
}