1) new FileInputStream("file.name")
2) new InputStreamReader(new FileInputStream("file.name"))
3) new BufferedReader(new InputStreamReader(new FileInputStream("file.name")))
4) new RandomAccessFile raf=new RandomAccessFile("myfile.txt",
Answer 3:
3) new BufferedReader(new InputStreamReader(new FileInputStream("file.name")))
The key to this question is that it asks about tens of megabytes of data, implying that performance is an issue. A Buffered Reader will optimise the performance of accessing a file. Although the objectives do not specifically mention it questions on I/O do come up on the exam.
No comments:
Post a Comment