Input seems as requested.
package com.codegym.task.task19.task1926;
/*
Mirror image
/Users/lilianetop/Desktop/taak1925Input.txt
*/
import java.io.*;
public class Solution {
public static void main(String[] args) {
String input = "";
StringBuilder sb = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
input = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
try(BufferedReader reader2 = new BufferedReader(new FileReader(input))) {
while(reader2.ready()){
String line = reader2.readLine();
//reverse the line not the entire document
//this is not working as it adds 2 line together and doesn't reverse the last line
//sb.reverse().append(line + "\n");
sb.append(line + "\n");
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(sb.reverse().toString());
}
}