[十分诡异的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);} 菜鸟求解! 请问怎么用JAVA取当前时间的给定形式啊? “两组”多线程同步的问题 System.out用的是什么编码规则? java常用包有几个? Socket通讯并发量大的情况下超时问题 大家讨论一下!!进者有分! 复旦的软件工程硕士怎么样? 请问哪里有基于Linux的java编辑器或开发工具下载? 在applet或者application中如何改变鼠标的样式? 求一个正则 Java synchronized 锁问题
prop.load(new FileReader(""));
没有给出文件的具体路径及文件名,当然会报错!FileNotFoundException!
InputStream input = null;
try {
input = new FileInputStream("config.properties");
// load a properties file
prop.load(input);
}