what are the benefits of BufferedReader over Scanner

前端 未结 3 483
清酒与你
清酒与你 2021-01-14 21:20

here\'s a code about depth first search in graphs. who knows why bufferedReader class were used in this code? and why nextInt function not used instead? what is its privileg

3条回答
  •  盖世英雄少女心
    2021-01-14 21:59

    Probably, when this code was written, the Scanner class didn't exist (in fact java 1.4 did not have the Scanner class), or maybe who written this code simply preferred using BufferedReader's readLine method instead of using Scanner.nextLine() method, i can't see other explainations about your question

提交回复
热议问题