We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d443efa commit 364e65cCopy full SHA for 364e65c
1 file changed
koans/src/intermediate/AboutFileIO.java
@@ -12,7 +12,7 @@ public class AboutFileIO {
12
13
@Koan
14
public void fileObjectDoesntCreateFile() {
15
- File f = new File("foo.txt");
+ File f = new File("i-never.exist");
16
assertEquals(f.exists(), __);
17
}
18
@@ -29,11 +29,12 @@ public void fileCreationAndDeletion() throws IOException {
29
public void basicFileWritingAndReading() throws IOException {
30
File file = new File("file.txt");
31
FileWriter fw = new FileWriter(file);
32
- fw.write("First line\nSecond line");
+ String data = "First line\nSecond line";
33
+ fw.write(data);
34
fw.flush();
35
fw.close();
36
- char[] in = new char[50];
37
+ char[] in = new char[data.length()];
38
int size = 0;
39
FileReader fr = new FileReader(file);
40
size = fr.read(in);
0 commit comments