z****u 发帖数: 15 | 1
You are not using the right classes. In JDK1.1 and later,
use
PrintWriter dos = new PrintWriter( new
FileWriter("file.txt"));
dos.println("a string here");
why do you think it is NOT simple?
In C:
FILE dos = fopen("file.txt", "w");
fprint(dos, "a string here\n");
In C++
ofstream dos = new ofstream("file.txt");
dos << "a string here" << endl;
same logic, same approach |
|