Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ReadAndWriteIO {
- public void OpenFile ()
- {
- try {
- String line;
- BufferedReader in;
- BufferedWriter out;
- in = new BufferedReader(new FileReader("input.txt"));
- out = new BufferedWriter(new FileWriter("output.txt"));
- while ((line = in.readLine()) != null){
- System.out.println(line);
- out.write(line);
- }
- in.close();
- out.close();
- }
- catch(IOException e)
- {
- System.out.println("Tiedostoa ei löydy.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement