if you're using NIX you could do something like
java helloWorld |& tee helloWorld.log
this runs your java program, echoing the output to both screen and logfile (useful if you require user interaction) and then print helloWorld.log. This method should work on MAC as well
I don't think there is a utility provided by M$ which is as powerful as tee,
so you are faced with the following options
1) redirect your output from the console (doesn't allow interaction)
java helloworld -> helloWorld.log ->2 helloWorldErrors.log
2) run from a console and mark-copy-paste output
java helloworld
3) download a decent 3rd party java console which allows you to save output
4) download GNU Utilities for windows which provides tee and a bunch of other useful commands
Native Win32 ports of some GNU utilities
Greetings.