-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
31 lines (27 loc) · 692 Bytes
/
Main.java
File metadata and controls
31 lines (27 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package FileWriter;
import java.io.FileWriter;
import java.io.IOException;
public class Main {
public static void main(String args[]) {
FileWriter writer = null;
try {
writer = new FileWriter("src/FileWriter/dosya.txt",true);
// writer.write("ferdi bulus\n");
// writer.write("erdi bulus\n");
writer.write("eymen uras\n");
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("Dosya acilirken IOException olustu.");
}
finally{
if(writer !=null) {
try {
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("Dosya kapatilirken bir hata olustu..");
}
}
}
}
}