подскажите, где ошибка ?
package com.javarush.task.task16.task1630;
import java.io.*;
public class Solution {
public static String firstFileName;
public static String secondFileName;
//add your code here - добавьте код тут
static {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
firstFileName = reader.readLine();
secondFileName = reader.readLine();
} catch (IOException e) {
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();
//add your code here - добавьте код тут
f.join();
try {
System.out.println(f.getFileContent());
} catch (IOException e) {
e.printStackTrace();
}
}
public interface ReadFileInterface {
void setFileName(String fullFileName);
String getFileContent() throws IOException;
void join() throws InterruptedException;
void start();
}
//add your code here - добавьте код тут
public static class ReadFileThread extends Thread implements ReadFileInterface {
private String thisFileName = "";
private String s = "";
@Override
public void setFileName(String fullFileName) {
thisFileName = fullFileName;
}
@Override
public String getFileContent() {
if (s == null)
return "";
else
return s;
}
@Override
public void run() {
String temp;
try {
BufferedReader reader = new BufferedReader(new FileReader(thisFileName));
while ((temp = reader.readLine()) != null){
s.concat(temp + " ");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}