Also, when I tried implementing what you said, this came up : "cannot find symbol", refering to the s variable on the write method and both on the writes.
You have to pass the string variable to the methods, whatever the name of the variable is - the error is there because it is more than likely that s is not defined in the context of your code. Provide more context, and you might get a more specific answer.
I don't really understand the "//here is how your handle the exception"...
See
Lesson: Exceptions (The Java™ Tutorials > Essential Classes)
I looked up how to log in java and something like this came up...
This is a very simple and rudimentary logging practice. I presume you are a novice, but will provide this here for what it is worth: for more advanced and flexible alternatives, see
http://www.javaprogrammingforums.com...6-logging.html