Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/File-input-output/Java/file-input-output-1.java
Normal file
18
Task/File-input-output/Java/file-input-output-1.java
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import java.io.*;
|
||||
|
||||
public class FileIODemo {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
FileInputStream in = new FileInputStream("input.txt");
|
||||
FileOutputStream out = new FileOutputStream("ouput.txt");
|
||||
int c;
|
||||
while ((c = in.read()) != -1) {
|
||||
out.write(c);
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue