Что тут не так? Валидатор не принимает
package com.javarush.task.task16.task1630;
import java.io.*;
public class Solution {
public static String firstFileName;
public static String secondFileName;
//add your code here - добавьте код тут
public static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static {
try {
firstFileName = reader.readLine();
secondFileName = reader.readLine();
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws InterruptedException, IOException {
systemOutPrintln(firstFileName);
systemOutPrintln(secondFileName);
}
public static void systemOutPrintln(String fileName) throws InterruptedException, IOException {
ReadFileInterface f = new ReadFileThread();
f.setFileName(fileName);
f.start();
//add your code here - добавьте код тут
f.join();
System.out.println(f.getFileContent());
}
public interface ReadFileInterface {
void setFileName(String fullFileName) throws IOException;
String getFileContent();
void join() throws InterruptedException;
void start();
}
//add your code here - добавьте код тут
public static class ReadFileThread extends Thread implements ReadFileInterface{
String filename;
String text = "";
public void setFileName(String fullFileName) {
filename = fullFileName;
}
public void run() {
FileReader fr= null;
try {
fr = new FileReader(filename);
int i;
while((i=fr.read())!=-1)
text += String.valueOf((char)i);
fr.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e){
e.printStackTrace();
}
}
public String getFileContent(){
return text;
}
}
}