0

What is the best way to access data from files in java.?

Which is good to use charStream , byteStream or is there any way to access whole string? First time facing file Handling. Thanks

18th Dec 2019, 1:35 PM
Abdul Wahab
Abdul Wahab - avatar
4 Answers
+ 2
Create an instance of the File class and pass it as an argument to the Scanner class instance. Then you can use a while loop to iterate and print the file content. There are many other ways.
18th Dec 2019, 1:53 PM
Avinesh
Avinesh - avatar
+ 1
You can use buffered reader also
19th Dec 2019, 4:05 AM
Naman Pandey
Naman Pandey - avatar
0
Which one is most suitable and efficient way ?
18th Dec 2019, 1:54 PM
Abdul Wahab
Abdul Wahab - avatar
18th Dec 2019, 1:54 PM
Abdul Wahab
Abdul Wahab - avatar