i have already send u this import java.io.*; class a{ static public void main(String[] args)throws Exception{ CharArrayWriter caw=new CharArrayWriter(); caw.write(65); caw.close(); caw.writeTo(new FileOutputStream"c:\\yasir.txt")); }} this is not writting in file tell me what i do.
There are several problems with your code: 1) It has a syntax error, it is missing an open paren before the file name. 2) It doesn't compile because CharArrayWriter.writeTo() takes a Writer not an OutputStream. 3) You don't flush and close the File, which causes the character not to be written to the file. Here is some code that works:
Out of curiosity, why are you using the CharArrayWriter? You could write to the FileWriter directly without the intermediate buffer.
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
a bit of art, as a gift, the permaculture playing cards