Possible Duplicate:
Scanner vs. BufferedReader
Is there any situation in which it’s apropriate to use java.util.Scanner in order to read input of some sort? In my small test I’ve found it to be incredibly slow compared to java.util.Bufferedreader or implementing your own reader from java.util.InputStreamReader.
So is there any reason as to why I would want to use a Scanner?
The
Scannerclass main purpose is for parsing text for primitive types and strings using regular expressions. You can provide several resource types to read from.