How do BufferedReaders work vs Scanners? via /r/learnprogramming


How do BufferedReaders work vs Scanners?

BufferedReader br = new BufferedReader(new InputStreamReader (System.in));

Scanner scanner = new Scanner(System.in);

Between these two ways of using scanners for keyboard inputs, what are the most important differences between how they operate and when should one be used over the other? I read briefly on stackoverflow that scanners are good for tokens and parsing whereas bufferedreaders are only for reading something in but I'm not sure why this is and what practical applications differences between these two have. Thanks.

Submitted July 17, 2017 at 05:36PM by eatingpoopinrobarts
via reddit http://ift.tt/2uCglCT

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s