try{
String path2="G:\\mainbishe\\javaprogram\\logready.txt";
FileReader fr=new FileReader(file.toString());
FileWriter fw=new FileWriter(path2);
System.out.println("Find path!!!") ;
BufferedReader br=new BufferedReader(fr);<--------想访问这个实例br
BufferedWriter bw=new BufferedWriter(fw);
String Line=br.readLine();
}catch(Exception e){}//扑捉ioException异常。
class Trim{
public String trim(String str)
{
//FileReader fr=new FileReader(file.toString());
//BufferedReader br=new BufferedReader(fr);
if(str!=null){
if(str.startsWith("{c"))
try{
str=br.readLine(); <------- 这条语句出现错误
trim(str);
}catch(Exception e){}
return str;
}
}
}
String path2="G:\\mainbishe\\javaprogram\\logready.txt";
FileReader fr=new FileReader(file.toString());
FileWriter fw=new FileWriter(path2);
System.out.println("Find path!!!") ;
BufferedReader br=new BufferedReader(fr);<--------想访问这个实例br
BufferedWriter bw=new BufferedWriter(fw);
String Line=br.readLine();
}catch(Exception e){}//扑捉ioException异常。
class Trim{
public String trim(String str)
{
//FileReader fr=new FileReader(file.toString());
//BufferedReader br=new BufferedReader(fr);
if(str!=null){
if(str.startsWith("{c"))
try{
str=br.readLine(); <------- 这条语句出现错误
trim(str);
}catch(Exception e){}
return str;
}
}
}
也可以用Exception,如果要用IOException一定要import java.io.*;
needs to be declared final
symbol:variable br
Line=br.readLine();
...
}
如果是,加上final应该可以了。
如果不是,你就需要用楼上的朋友说的那个办法,但是在自变量的声明前,最好也加上
final修饰。
trim(String str,final BufferedReader br)({
}