Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Keypad
- {
- private Scanner input; // reads data from the command line
- // no-argument constructor initializes the Scanner
- public Keypad(){
- input = new Scanner(System.in);
- } // end no-argument Keypad constructor
- // return an integer value entered by user
- public int getInput(){
- return input.nextInt(); // we assume that user enters an integer
- } // end method getInput
- } // end class Keypad
Advertisement
Add Comment
Please, Sign In to add comment