package JAVA_API.Test;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import java.io.*;
import java.util.Arrays;
/**
* @author yyc
* 2021/9/25 20:43
*/
public class Week5Test {
public static void main(String[] args) throws FileNotFoundException {
Thread thread1 = new Thread(){
@Override
public void run() {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("string.txt")));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("string2.txt",true)));
String[] str1 = br.readLine().split("\\s+");
String[] str2 = br.readLine().split("\\s+");
System.out.println(Arrays.toString(str1));
System.out.println(Arrays.toString(str2));
int index = 0;
System.out.print("{");
bw.write("{");
while(index < str1.length-1){
System.out.print(str1[index] + "=" + str2[index] + ",");
bw.write(str1[index] + "=" + str2[index] + ",");
index++;
}
if (index == str1.length-1){
System.out.print((str1[index] + "=" + str2[index]));
bw.write(str1[index] + "=" + str2[index]);
}
bw.write("}");
bw.close();
br.close();
System.out.println("}");
} catch (Exception e) {
e.printStackTrace();
}
}
};
thread1.start();
}
}