Uno scanner di testo introdotto nella versione 5.0 per facilitare l’I/O testuale
public final class Scanner extends Object implements Iterator
Funziona con stringhe, file … e accetta delimitatori diversi (anche espressioni regolari…).
Costruttori
Scanner(File) Scanner(InputStreamer) Scanner(String) ...
Metodi
boolean |
nextBoolean() |
byte |
nextByte() |
short |
nextShort() |
int |
nextInt() |
long |
nextLong() |
float |
nextFloat() |
double |
nextDouble() |
String |
next() // una parola... nextLine() // una linea... |
BigDecimal |
nextBigDecimal() |
BigInteger |
nextBigInteger() |