What is system.in

前端 未结 9 1211
隐瞒了意图╮
隐瞒了意图╮ 2021-02-06 05:50

Consider this Scanner input example.

Scanner user_input = new Scanner( System.in );

Here Scanner is the CLASS.

9条回答
  •  萌比男神i
    2021-02-06 06:24

    Scanner class accepts input stream as a parameter and System class have a static variable in which is of type InputStream. System.in gives you a instance of of type InputStream.

    Check this doc of public static final InputStream in

    The "standard" input stream. This stream is already open and ready to supply input data.

提交回复
热议问题