-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssigment1.java
More file actions
39 lines (33 loc) · 1.24 KB
/
Assigment1.java
File metadata and controls
39 lines (33 loc) · 1.24 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
/*Q1 . a.txt File b.text File Output Screen
AAA 111 AAA
BBB 222 BBB
CCC 333 CCC
111
222
333
*/
import java.io.*;
/**
*
* @author Nazim
*/
public class Assigment1 {
public static void main(String[] args) throws IOException{
try (FileReader fr1 = new FileReader ("C:\\Nazim\\a.txt");
FileReader fr2 = new FileReader ("C:\\Nazim\\b.txt") ) {
BufferedReader br1 = new BufferedReader(fr1);
BufferedReader br2 = new BufferedReader(fr2);
String sCurrentLine1;
String sCurrentLine2;
while (((sCurrentLine1=br1.readLine() ) != null) ) {
System.out.println(sCurrentLine1);
}
while (((sCurrentLine2=br2.readLine() ) != null) ) {
System.out.println(sCurrentLine2);
}
} catch (IOException e) {
System.out.println(e);
}
// br.close();
}
}