📜  为什么 bufferedreader 比扫描器快 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:42.908000             🧑  作者: Mango

代码示例1
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: