Monday, May 24, 2010

Debug java?

import java.io.*;


class SequenceBuffered


{


public static void main(String args[]) throws Exception


{





FileInputStream file1=new FileInputStream("a.txt");


FileInputStream file2=new FileInputStream("b.txt");


SequenceInputStream sis=new SequenceInputStream(file1,file2);


BufferedInputStream bf=new BufferedInputStream(sis);


BufferedOutputStream bos=new BufferedOutputStream(System.out);


while((ch=bf.read())!=-1)


{


bos.write((char)ch);


}


bf.close();


bos.close();


file1.close();


file2.close();


}


}





/*C:\Documents and Settings\sulav\Desktop\New Folder\SequenceBuffered.java:12: cannot find symbol


symbol : variable ch


location: class SequenceBuffered


while((ch=bf.read())!=-1)


^


C:\Documents and Settings\sulav\Desktop\New Folder\SequenceBuffered.java:14: cannot find symbol


symbol : variable ch


location: class SequenceBuffered


bos.write((char)ch);


^


2 errors





Tool completed with exit code 1*/

Debug java?
where have you declared ch before using it in the while loop ?
Reply:Verify your version of Java. If you don't have the latest update, update it.





http://www.java.com/en/download/installe...

salary survey

No comments:

Post a Comment