Skip to content

Commit 4139515

Browse files
committed
first commit
1 parent 6dd2007 commit 4139515

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

FileOutputStreamExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.io.*;
2+
3+
public class FileOutputStreamExample {
4+
public static void main(String[] args) throws IOException {
5+
// FileOutputStream fout = new FileOutputStream("../Java/temp.txt", true);
6+
7+
File f1 = new File("../Java/temp.txt");
8+
FileOutputStream fout = new FileOutputStream(f1);
9+
10+
String s = "Hello World!!";
11+
12+
char ch[] = s.toCharArray();
13+
for (int i = 0; i < s.length(); i++)
14+
fout.write(ch[i]);
15+
16+
fout.close();
17+
}
18+
}

0 commit comments

Comments
 (0)