public class EntradaTeclado
extends java.lang.Object
Constructor and Description |
---|
EntradaTeclado() |
Modifier and Type | Method and Description |
---|---|
static double |
leDouble()
Le um string do teclado (uma linha toda) e tenta transformá-lo num double.
|
static int |
leInt()
Le um string do teclado (uma linha toda) e tenta transformá-lo num inteiro.
|
static java.lang.String |
leString()
Le um string digitado pelo teclado, até que seja pressionado
um enter.
|
public static double leDouble() throws java.io.IOException, java.lang.NumberFormatException
java.io.IOException
- Lançada ao chamar leStringjava.lang.NumberFormatException
- Lançada ao tentar converter o String lido em número doublepublic static int leInt() throws java.io.IOException, java.lang.NumberFormatException
java.io.IOException
- Lançada ao chamar leStringjava.lang.NumberFormatException
- Lançada ao tentar converter o String lido em número inteiropublic static java.lang.String leString() throws java.io.IOException
java.io.IOException
- Essa exceção é lançada quando o método não consegue ler o
string a partir do teclado.