И ещё по последнему пункту: "Вывод должен содержать содержимое первого файла."..ну он то его содержит..
А про пустую строку что-то вообще не понял
package com.javarush.task.task16.task1630;
import java.io.*;
public class Solution {
public static String firstFileName = null;
public static String secondFileName = null;
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static {
try {
firstFileName = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
try {
secondFileName = reader.readLine();
} catch (IOException 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();
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{
BufferedReader br;
String txt = null;
public void setFileName(String fullFileName){
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(fullFileName)));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
public String getFileContent(){
return txt;
}
public void run(){
try {
txt = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}