Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class HW01_3{
- public static void main(String[] args) throws IOException {
- File izvor = new File("izvor.txt");
- File destinacija = new File("Destinacija.txt");
- BufferedReader input = null;
- BufferedWriter output = null;
- StringBuilder sb = new StringBuilder();
- try {
- input = new BufferedReader(new FileReader(izvor));
- output = new BufferedWriter(new FileWriter(destinacija));
- String line;
- while((line = input.readLine()) != null){
- sb.append(line);
- }
- output.write(sb.reverse().toString());
- }finally {
- input.close();
- output.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement