简体   繁体   English

使用从 Java 加载 class 导入属性文件时出错

[英]Error while using the load class from Java to import property file

I've seen several examples of reading a properties file, but I can't seem to get it to work, am I missing a "load" method/class?我看过几个读取属性文件的例子,但我似乎无法让它工作,我是否缺少“加载”方法/类? Even the import does not work.即使导入也不起作用。

Please see attached image for more infomation:请参阅附图以获取更多信息:

image图片

Naming your class Properties is shadowing java.util.Properties .命名您的 class Properties会影响java.util.Properties You either need to rename your class to something like MyProperties , or qualify each access to java.util.Properties and remove the import.您需要将 class 重命名为MyProperties之类的名称,或者限定对java.util.Properties的每次访问并删除导入。

private static java.util.Properties config = new java.util.Properties();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM