[十分诡异的JAVA题]关于Load方法问题 FileReader fr = new FileReader(new File("property.properties"));Properties prop = new Properties();prop.load(fr);System.out.println(prop.getProperty("username"));没有问题啊,是否楼主给的reader 中的文件名是个非法的文件名或其他原因呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼主提供的2行代码有问题啊!Properties prop = new Properties(); prop.load(new FileReader(""));没有给出文件的具体路径及文件名,当然会报错!FileNotFoundException! Properties prop = new Properties(); InputStream input = null; try { input = new FileInputStream("config.properties"); // load a properties file prop.load(input);} 为什么用System.exit(0)无法退出? 这个错误怎么解决,急急急!!! 这道题选嘛呢? 安装的oracle 10g Express Edition进不了数据库主页 SWT,JFace 怎么设置表格颜色? java中如何将Frame框架放在屏幕中央 [求助]JCreator中的JDK配置(进者有分!) jb加文件的问题:)谢谢!! 明天我帮别人考JAVA,但我不是学这个的,现在有几个例子请大家帮忙做一做。急!!! 创建对象的过程是违背开闭原则和依赖倒置原则,求解 求一个正则 Java synchronized 锁问题
prop.load(new FileReader(""));
没有给出文件的具体路径及文件名,当然会报错!FileNotFoundException!
InputStream input = null;
try {
input = new FileInputStream("config.properties");
// load a properties file
prop.load(input);
}