Java:Scanner
De W3API
Contenido |
[editar] Descripción
Scanner es una clase que nos permite analizar textos mediante patrones para descubrir tipos de datos primitivos en él. Se le puede configurar un delimitador para saber hasta donde tiene que leer el texto.
[editar] Sintaxis
public final class Scanner extends Object implements Iterator<String>
[editar] Ejemplo
Scanner reader = new Scanner(System.in);
System.out.println("Introduce un texto");
System.out.println(reader.next());
[editar] Campos
[editar] Constructores
[editar] Métodos
- close()
- delimiter()
- findInLine()
- findWithinHorizon()
- hasNext()
- hasNextBigDecimal()
- hasNextBigInteger()
- hasNextBoolean()
- hasNextByte()
- hasNextDouble()
- hasNextFloat()
- hasNextInt()
- hasNextLine()
- hasNextLong()
- hasNextShort()
- ioException()
- locale()
- match()
- next()
- nextBigDecimal()
- nextBigInteger()
- nextBigInteger()
- nextByte()
- nextDouble()
- nextFloat()
- nextInt()
- nextLine()
- nextLong()
- nextShort()
- radix()
- remove()
- reset()
- skip()
- toString()
- useDelimiter()
- useLocale()
- useRadix()