-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSem2_T3_6.java
More file actions
27 lines (23 loc) · 833 Bytes
/
Sem2_T3_6.java
File metadata and controls
27 lines (23 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import java.io.*;
public class Sem2_T3_6 {
public static void main(String[] args) throws IOException {
BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\Result4.txt"));
BufferedReader b1 = new BufferedReader(new FileReader("D:\\odd.txt"));
BufferedReader b2 = new BufferedReader(new FileReader("D:\\even.txt"));
String o = b1.readLine();
String e = b2.readLine();
while (o != null || e != null) {
if (o != null) {
bw.write(o);
bw.newLine();
o = b1.readLine();
}
if (e != null) {
bw.write(o);
bw.newLine();
e = b2.readLine();
}
}
bw.close(); b1.close(); b2.close();
}
}