+ 2

What is the difference between BufferedReader and Scanner in java?

I know both are used for input and they have different methods, but what exactly are their pros and cons and how to choose between them? Update: Thanks for answering but as far as I know Scanner can also read files and I'm asking why would I choose BufferedReader over Scanner? I was asking If BufferedReader has any feature which Scanner doesn't have?

4th Jun 2017, 5:46 AM
Arunangshu Biswas
Arunangshu Biswas - avatar
2 Antworten
+ 1
I don't know if it's correct, but I use Scanner to read Standard Input, and BufferedReader to read files.
4th Jun 2017, 8:04 AM
Maria Zheng
Maria Zheng - avatar
0
scanner for reading the comments in the form of words or in a line sentence and bufferedreader for reading the files
4th Jun 2017, 2:19 PM
Jeeru Dudisty
Jeeru Dudisty - avatar