What is system.in

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

Consider this Scanner input example.

Scanner user_input = new Scanner( System.in );

Here Scanner is the CLASS.

9条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 06:36

    From the source:

    System.in is an InputStream which is typically connected to keyboard input of console programs. System.in is not used as often since data is commonly passed to a command line Java application via command line arguments, or configuration files. In applications with GUI the input to the application is given via the GUI. This is a separate input mechanism from Java IO.

提交回复
热议问题