why is bufferedreader faster than scanner code example
Example: why bufferedreader is faster than scanner
Difference between BufferedReader and Scanner are following:
BufferedReader is synchronized but Scanner is not synchronized.
BufferedReader is thread safe but Scanner is not thread safe.
BufferedReader has larger buffer memory but Scanner has smaller buffer memory.
BufferedReader is faster but Scanner is slower in execution.
Code to read a line from console: