S
Sharp
Hi
Consider the following:
<code>
PrintWriter out = new PrintWriter(new BufferedWriter(new
FileWriter("foo.out")));
if (//condition 1)
{
out.println("data 1"); // prints to foo.out
}
/* can I make "out" point to a new file name without closing the stream and
creating a new printwrtiter object? I doubt it's possible to share a stream
between two files.
else
{
out.println("data 2"); //prints into another file bar.out
}
Regards
Sharp
Consider the following:
<code>
PrintWriter out = new PrintWriter(new BufferedWriter(new
FileWriter("foo.out")));
if (//condition 1)
{
out.println("data 1"); // prints to foo.out
}
/* can I make "out" point to a new file name without closing the stream and
creating a new printwrtiter object? I doubt it's possible to share a stream
between two files.
else
{
out.println("data 2"); //prints into another file bar.out
}
Regards
Sharp