Беда в том, что я ещё не могу сам себя проконтролировать, потому что вывод с консоли:
�}� � docProps/core.xmlPK - ! ���
�o �¬ word/styles.xmlPK
� �*
word/settings.xmlPK - ! � �
Сам не могу найти, как проблему решить. Пытался, но результат не изменился
package com.javarush.task.task16.task1630;
import java.io.*;
import java.util.Scanner;
public class Solution {
public static String firstFileName;
public static String secondFileName;
static {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
firstFileName = reader.readLine();
secondFileName = reader.readLine();
reader.close();
} catch (IOException e){
}
}
//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 extends Runnable {
void setFileName(String fullFileName);
String getFileContent();
void join() throws InterruptedException;
void start();
}
public static class ReadFileThread extends Thread implements ReadFileInterface{
public String FN;
public String file = "";
@Override
public void run() {
try{
FileReader fileReader = new FileReader(FN);
Scanner sc = new Scanner(fileReader);
while (sc.hasNextLine()){
file = sc.nextLine() + " ";
}
fileReader.close();
} catch (Exception e){
System.out.println(e);
}
}
@Override
public void setFileName(String fullFileName) {
FN = fullFileName;
}
@Override
public String getFileContent() {
return file;
}
}
//add your code here - добавьте код тут
}