• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting output back to the console  RSS feed

 
nash saraj
Greenhorn
Posts: 12
Android Chrome Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have used

to output to the file ss.txt. Now i want to redirect the output back to the console and a java swing screen.

Please tell how can i revert back to console.

Thanking you


Regards
 
Junilu Lacar
Sheriff
Posts: 11485
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you want to restore it later on, then you should save the value of System.out before you redirect it in the first place.

 
nash saraj
Greenhorn
Posts: 12
Android Chrome Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:Well, if you want to restore it later on, then you should save the value of System.out before you redirect it in the first place.



In my case i have two different files.  FirstApplet.java and ParserDemo.java. In firstapplet.java, i want to redirect the output to the file. But in ParserDemo I again to take the output back to console. Do i need to pass stdout to parserdemo's constructor ? Means that is there any need to pass as a parameter the object of PrintStream.java so that the object's reference gets saved, to be used later in parserdemo.java ?

Thanking you once again.


Regards
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!