Storing a printed line into a String?
<p>I'd like to know if there is any way to store a series of texts which are printed using System.out.print into a specific String so that it can be used to recall the line in the future.</p>

<p>For example :</p>

<pre><code>String oldLine=null;
int x = 4;
for (int i=0; i&lt;10; i++) {
int result = x+i;
System.out.print(result+"\t"); }
</code></pre>

<p>The result would be then something like:</p>

<pre><code>4   5  6  7  9  10 ....
</code></pre>

<p>Now I'd like to know if I can store this line into:</p>

<pre><code>String oldLine;
</code></pre>

<p>So whenever I print oldLine I can print the same line as : </p>

<pre><code>4   5  6  7  9  10 ....   
</code></pre>
