01/10/2018, 17:33

If You're Using Java’s Scanner Class for Keyboard Input, You're Doing it Wrong

dzone.com

If You're Using Java’s Scanner Class for Keyboard Input, You're Doing it Wrong -...

In this post, we look at the Scanner class in Java and how using it for keyboard input could potentially be closing a System stream that cannot be re-opened.

Nguyễn Đình Anh viết 19:40 ngày 01/10/2018

Thật ra thì có 2 cách để nhập từ bàn phím:

  • Scanner
  • BufferReader

Nhưng có vẻ mọi người hay dùng Scanner nhiều hơn vì nó khai báo ngắn hơn

https://www.geeksforgeeks.org/difference-between-scanner-and-bufferreader-class-in-java/

Bài liên quan
0