Home > Back-end >  A small problem about Scanner
A small problem about Scanner

Time:10-03

Such as Scanner sc=new Scanner (System.) in the
Sc play what role, is just a temporary storage function

CodePudding user response:

Source code is this: in public final class Scanner implements Iterator , Closeable

Scanner realized the Iterator interface, can be said to be played the role of an Iterator System. This is an input stream in object, equivalent to read the content from the console, and the content of the sc is responsible for the read in a variety of ways to get out, such as nest (), nextInt (), nextString (), nextFloat (), etc.

CodePudding user response:

Source code comments as follows: a simple text scanner, you can use a regular expression parsing the basic types and string,

CodePudding user response:

refer to the second floor Nonoas response:
source code comments as follows: a simple text scanner, you can use a regular expression parsing basic types and string,

A regular expression is what ah

CodePudding user response:

reference qq_46653873 reply: 3/f
Quote: refer to the second floor Nonoas response:
source code comments as follows: a simple text scanner, you can use a regular expression parsing basic types and string,

A regular expression is what ah

baidu

CodePudding user response:

Sc is an instantiated object of Scanner, just like you in water with a faucet, when you need to call it to read the content is invoked, simply be an instantiation of the tool
  • Related