title: Read my own printed line in console
body: <p>Is there a way in which, from a function, I print a String in with System.out.print() and then read it from another function?</p>
  
  <p>something like:</p>
  
  <pre><code>void printC(String foo){
      System.out.print(foo);
  }
  
  void read(){
      String c;
      while(something){
          printC(somethingElse);
          c = System.console.readLine();
          JOptionPane.showMessageDialog(c);
      }
  }
  </code></pre>