В чём моя ошибка... Не пропускает по 5 и 7 пункту
package com.javarush.task.task16.task1630;
import java.io.*;
public class Solution {
public static String firstFileName;
public static String secondFileName;
static {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
firstFileName = reader.readLine();
secondFileName = reader.readLine();
} catch (IOException e) {
System.out.println("Сработало исключение в static");
e.printStackTrace();
}
}
public static void main(String[] args) throws InterruptedException {
systemOutPrintln(firstFileName);
systemOutPrintln(secondFileName);
}
public static void systemOutPrintln(String fileName) throws InterruptedException {
ReadFileInterface f = new ReadFileThread();
f.setFileName(fileName);
f.start();
f.join();
System.out.println(f.getFileContent());
}
public interface ReadFileInterface {
void setFileName(String fullFileName);
String getFileContent();
void join() throws InterruptedException;
void start();
}
public static class ReadFileThread extends Thread implements ReadFileInterface {
private String fullFileName;
private String strLine = null;
@Override
public void run() {
getFileContent();
}
@Override
public void setFileName(String fullFileName) {
this.fullFileName = fullFileName;
}
@Override
public String getFileContent() {
try {
strLine = null;
FileInputStream ireader = new FileInputStream(fullFileName);
BufferedReader br = new BufferedReader(new InputStreamReader(ireader));
strLine = br.readLine();
} catch (Exception e) {
System.out.println("Ошибка чтения файла!");
e.printStackTrace();
}
return strLine;
}
}
}