Dr_U

InputReader

Nov 11th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1.  
  2. /**
  3.  * class berfungsi agar user dapat menginput pertanyaan yang generic
  4.  * @author Yusuf Anfasya
  5.  * @version 0.1 inputreader
  6.  */
  7. import java.util.Scanner;
  8. import java.util.HashSet;
  9.  
  10. public class InputReader
  11. {
  12.     // instance variables - replace the example below with your own
  13.     private Scanner scanner;
  14.  
  15.     /**
  16.      * Constructor for objects of class InputReader
  17.      */
  18.     public InputReader()
  19.     {
  20.         scanner = new Scanner(System.in);
  21.     }
  22.  
  23.     /**
  24.      * An example of a method - replace this comment with your own
  25.      *
  26.      * @param  y  a sample parameter for a method
  27.      * @return    the sum of x and y
  28.      */
  29.     public String getInput()
  30.     {
  31.         System.out.print(">>_<<");
  32.         String Input = scanner.nextLine();
  33.         return  Input;
  34.     }
  35. }
  36.  
Add Comment
Please, Sign In to add comment