Properties-读取的方式

1.Java中读取 properties文件获取其路劲的方法

  1).最常用的的读取properties的方法

  InputStream in=getClass().getResourceAsStream("路劲")

 2)利用反射机制采用 getClassLoader() 加载器:最常用的方式

    InputStream in=getClass().getClassLoader().getResourceAsStream("/upload.properties");

原文地址:https://www.cnblogs.com/woainifanfan/p/6709554.html