Java - Please look at this code and tell me what's wrong with it
I recently as said in my introduction became interested in coding my own RSPS, I'm using Project Insanity Source code and Client, and I was adding in a command for a ::trusted, which builds a list of trusted players....
This is the code im using but I'm thinking that it's wrong somehow, can someone please read over it and add suggestions :)
Re: Java - Please look at this code and tell me what's wrong with it
herez the corrected version of code with some addition, more suitable error handling and example of implementing
you had a try block opened but never closed, i guess you havent put the bottom part of the code
you havent caught the BufferedWriter.close() throwing exceptio in the finally block
it is always good to have finally after all
and the best pratice would be to simply throw the error out of the method body and handle them all at one place
and BufferedReader.write method has a simple 'w'
hope this code will help :)
|All times are GMT +5.5. The time now is 02:07.|