The output stream for the first file is not closed!!!
Why line 40 is not working?
package com.codegym.task.task18.task1818;
/*
Two in one
*/
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String file1=br.readLine();
String file2=br.readLine();
String file3=br.readLine();
br.close();
FileInputStream fileInputStream1 = new FileInputStream(file2);
FileInputStream fileInputStream2 = new FileInputStream(file3);
FileOutputStream fileOutputStream = new FileOutputStream(file1);
byte[] bytes = new byte[fileInputStream1.available()];
int count=fileInputStream1.read(bytes);
fileOutputStream.write(bytes, 0, count);
byte[] bytes1=new byte[fileInputStream2.available()];
int count1=fileInputStream2.read(bytes1);
fileOutputStream.write(bytes1,0, count1);
fileInputStream1.close();
fileInputStream2.close();
fileOutputStream.close();
}
}