code: public String readText(String prompt) {
          if (!isInputStreamAvailable()) {
              return null;
          }
          try {
              return console.readLine(prompt);
          } catch (IOError e) {
              stderr.println("Exception while reading stdin: " + e.getMessage());
              e.printStackTrace(stderr);
          }
          return null;
      }
docs: Reads text from the input String, prompting with the given String.
  
  @param prompt
  @return String read from input.