Class Input
java.lang.Object
Input
An Input Object
An Input object contains methods to ask for user input
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleMethod to display a message and ask for double inputMethod to display a message and ask for integer inputMethod to display a message and ask for String input
-
Field Details
-
sc
Scanner scObject of class Scanner
-
-
Constructor Details
-
Input
Creates a new object of class Input- Parameters:
sc- Scanner object
-
-
Method Details
-
getInt
Method to display a message and ask for integer input- Parameters:
msgToPrint- Message to be displayed- Returns:
- ask for user input
-
getDouble
Method to display a message and ask for double input- Parameters:
msgToPrint- Message to be displayed- Returns:
- ask for user input
-
getLine
Method to display a message and ask for String input- Parameters:
msgToPrint- Message to be displayed- Returns:
- ask for user input
-