|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcorejava.Console
public class Console
Constructor Summary | |
---|---|
Console()
|
Method Summary | |
---|---|
static void |
printPrompt(java.lang.String prompt)
print a prompt on the console but don't print a newline |
static double |
readDouble(java.lang.String prompt)
read a floating point number from the console. |
static int |
readInt(java.lang.String prompt)
read an integer from the console. |
static java.lang.String |
readString()
read a string from the console. |
static java.lang.String |
readString(java.lang.String prompt)
read a string from the console. |
static java.lang.String |
readWord()
read a word from the console. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Console()
Method Detail |
---|
public static void printPrompt(java.lang.String prompt)
prompt
- the prompt string to displaypublic static java.lang.String readString()
public static java.lang.String readString(java.lang.String prompt)
prompt
- the prompt string to display
public static java.lang.String readWord()
public static int readInt(java.lang.String prompt)
prompt
- the prompt string to display
java.lang.NumberFormatException
- if bad inputpublic static double readDouble(java.lang.String prompt)
prompt
- the prompt string to display
java.lang.NumberFormatException
- if bad input
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |