Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- /**
- * Class untuk menerima inputan yang nantinya dikirimkan ke class SupportSystem.
- *
- * @author M.Fajri Davyza Chaniago
- * @version 16 November 2020
- */
- public class InputReader
- {
- private Scanner reader;
- public InputReader()
- {
- reader = new Scanner(System.in);
- }
- public HashSet<String> getInput()
- {
- System.out.print("> ");
- String inputLine = reader.nextLine().trim().toLowerCase();
- String[] wordArray = inputLine.split(" ");
- HashSet<String> words = new HashSet<String>();
- for (String word : wordArray)
- {
- words.add(word);
- }
- return words;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment