為什么創(chuàng)建不出來文件呢,我也刷新了
package?InputStreamDemo;
import?java.io.File;
import?java.io.IOException;
public?class?RandomAccessFileDemo?{
RandomAccessFileDemo()throws?IOException{
File?Demo?=?new?File("Demo");
if(!Demo.exists()){
Demo.mkdir();
}
File?file?=?new?File(Demo,"file.txt");
if(!file.exists()){
file.createNewFile();
}
}
public?static?void?main(String[]?args)?{
try{
new?RandomAccessFileDemo();
???????}catch(Exception?e){
???? ???
???????}
??}
}
2016-06-30
你確定刷新了?代碼沒錯(cuò)!重新創(chuàng)個(gè)項(xiàng)目再把代碼復(fù)制進(jìn)去試下