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
}
}
package de.codegym.task.task13.task1318;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.io.FileInputStream;
/*
Eine Datei einlesen
*/
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
}
}