当前位置: 技术问答>java相关
请帮我分析一下这段代码
来源: 互联网 发布时间:2015-07-20
本文导语: import java.io.*; public class Hello{ public static void main(String args[]){ try{ File xx=new File("d:1111.txt"); FileReader in=new FileReader(xx); int a=0; while ((a=in.read())>0) {System.out.print((char)a);} } catch (IOException e){System.out.print("IO is e...
import java.io.*;
public class Hello{
public static void main(String args[]){
try{
File xx=new File("d:1111.txt");
FileReader in=new FileReader(xx);
int a=0;
while ((a=in.read())>0)
{System.out.print((char)a);}
}
catch (IOException e){System.out.print("IO is error");
}}}
为什么总是出现IO is error这个语法错误的语句?
public class Hello{
public static void main(String args[]){
try{
File xx=new File("d:1111.txt");
FileReader in=new FileReader(xx);
int a=0;
while ((a=in.read())>0)
{System.out.print((char)a);}
}
catch (IOException e){System.out.print("IO is error");
}}}
为什么总是出现IO is error这个语法错误的语句?
|
File xx=new File("d:\11\11.txt");