开发者

Unclosed Character Literal error while writing an integer data in a file

开发者 https://www.devze.com 2022-12-07 20:12 出处:网络
I tried to write Integer data to my file using java.io.FileWriter it shows me error: unclosed characte开发者_StackOverflow社区r literal

I tried to write Integer data to my file using java.io.FileWriter it shows me

error: unclosed characte开发者_StackOverflow社区r literal

the error line:

        FileWriter fw=new FileWriter("fw.txt");
        fw.write(new char[]{'10','20','30'});
        fw.flush();

but when I try to write an character in the file using character array, there's no problem with the literals.

Trying to Read and Write integer data in a file only using java.io.BufferedReader.

0

精彩评论

暂无评论...
验证码 换一张
取 消