public class Solution { public static void main(String[] args) throws Exception { BufferedReader rd = new BufferedReader(new InputStreamReader(System.in)); String fileName = rd.readLine(); FileInputStream fileInputStream = new FileInputStream(fileName); Scanner scanner = new Scanner(fileInputStream); StringBuilder stringBuilder = new StringBuilder(); while(scanner.hasNextLine()) { stringBuilder.append(scanner.nextLine()).append("\n"); } System.out.println(stringBuilder.toString()); scanner.close(); rd.close();// schreib hier deinen Code } }