помогите, плз.
package com.javarush.task.task16.task1630;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
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) {
e.printStackTrace();
}}
public static class ReadFileThread extends Thread implements ReadFileInterface {
String fullFileName;
@Override
public String setFileName(String fullFileName) {
return this.fullFileName = fullFileName;
}
@Override
public String getFileContent() {
ArrayList<String> list = new ArrayList<String >();
Scanner scanner = new Scanner(fullFileName);
while (scanner.hasNext()){
list.add(scanner.nextLine());
}
return list.toString();
}
public String toString(ArrayList<String> list) {
String bla = "";
for (int i = 0; i < list.size(); i++) {
bla.concat(list.get(i)).concat(" ");
}
return bla;
}
@Override
public void run() {
start();
getFileContent();
try {
join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
//add your code here - добавьте код тут
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();
//add your code here - добавьте код тут
System.out.println(f.getFileContent());
}
public interface ReadFileInterface {
String setFileName(String fullFileName);
String getFileContent();
void join() throws InterruptedException;
void start();
}
//add your code here - добавьте код тут
}