USER INPUT USING BUFFEREDREADER AND SCANNER | JAVA

Publicado em: 18 Setembro 2021
no canal de: Technical Jahanvi
129
2

1
Synchronous
Scanner is not syncronous in nature and should be used only in single threaded case.
BufferReader is syncronous in nature. During multithreading environment, BufferReader should be used.
2
Buffer Memory
Scanner has little buffer of 1 KB char buffer.
BufferReader has large buffer of 8KB byte Buffer as compared to Scanner.
3
Processing Speed
Scanner is bit slower as it need to parse data as well.
BufferReader is faster than Scanner as it only reads a character stream.
4
Methods
Scanner has methods like nextInt(), nextShort() etc.
BufferReader has methods like parseInt(), parseShort() etc.
5
Read Line
Scanner has method nextLine() to read a line.
BufferReader has method readLine() to read a line.
Example of Scanner vs BufferReader


Java Integer parseInt (String s) Method. This method parses the String argument as a signed decimal integer object. ... It returns the integer value which is represented by the argument in a decimal integer.


Nesta página do site você pode assistir ao vídeo on-line USER INPUT USING BUFFEREDREADER AND SCANNER | JAVA duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Technical Jahanvi 18 Setembro 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 129 vezes e gostou 2 espectadores. Boa visualização!