为什么会出现——Syntax error on token ";", , expected的错误,请指教·····

yangjie19880826 2010-07-19 10:23:04
package cn.com.createfile;
import java.io.*;
public class CreateFile {
String file_name;
String expand_name;
File=file;
public CreateFile()
{
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
System.out.println("please enter the file name:");

try{
expand_name=b.readLine();
}catch(IOException e){}
if(file_name!=null)
System.out.println("please enter the file expand name:");

else return;
try{

File file = new File(file_name+"."+expand_name);
file.createNewFile();
}catch(IOException e){}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
CreateFile creatfile=new CreateFile();

}

}
...全文
1024 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangjie19880826 2010-07-19
  • 打赏
  • 举报
回复
不知道怎么结账啊·······顺便指教一下吧······
l3751202 2010-07-19
  • 打赏
  • 举报
回复
问题解决了要结贴呀
yangjie19880826 2010-07-19
  • 打赏
  • 举报
回复
谢谢,问题解决了,竟然是这个问题······
  • 打赏
  • 举报
回复
File=file;
不懂
closewbq 2010-07-19
  • 打赏
  • 举报
回复
File=file;
这是什么东西呀?赋值呀?呵呵,不细心了!
l3751202 2010-07-19
  • 打赏
  • 举报
回复
下面那行File=file;错误

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧