Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /**
  2. * Author : YogaOcean
  3. * Date : 04-Des-2016
  4. * Program : Keypad class (part of ATM case study)
  5. */
  6. import java.util.Scanner;
  7.  
  8. public class Keypad
  9. {
  10. private Scanner input; // reads data from the command line
  11.  
  12. // no-argument constructor initializes the Scanner
  13. public Keypad(){
  14. input = new Scanner(System.in);
  15. } // end no-argument Keypad constructor
  16.  
  17. // return an integer value entered by user
  18. public int getInput(){
  19. return input.nextInt(); // we assume that user enters an integer
  20. } // end method getInput
  21. } // end class Keypad
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement