code: public static String getPrivateInput(String prompt) {
          System.out.print(prompt);
  
          PrivateInputThread privateInput = new PrivateInputThread();
          BufferedReader in =
              new BufferedReader(new InputStreamReader(System.in));
  
          privateInput.start();
          try {
              return in.readLine();
          } catch(Exception e) {
              return null;
          } finally {
              privateInput.kill();
          }
      }
docs: Displays a prompt and then reads in private input from System.in.
  Characters typed by the user are replaced with a space on the screen.
  
  @param prompt  the prompt to be displayed
  @return <code>String</code> the input read in (entered after the prompt)