- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathReadFileFileReader.java
More file actions
Latest commit
26 lines (17 loc) · 553 Bytes
/
Copy pathReadFileFileReader.java
File metadata and controls
26 lines (17 loc) · 553 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
packagedemoproject;
importjava.io.FileNotFoundException;
importjava.io.FileReader;
importjava.io.IOException;
/*Reading File using FileReader*/
publicclassReadFileFileReader {
publicstaticvoidmain(String[] args) throwsIOException {
FileReaderfileReader = newFileReader("C:\\Users\\pc\\Desktop\\CollabQuestions.txt");
inti;
longstart = System.currentTimeMillis();
while ((i = fileReader.read()) != -1) {
System.out.println((char) i);
}
longend = System.currentTimeMillis();
System.out.println(end - start);
}
}