Common Java Error

person Jason Huangaccess_time January 1, 2009

Little things that causes errors:

1. If you have a throw e; e is an exception line in catch, in the method
that throws the exception, you have to have throw Exception line declared
in the method name.

2. a java variable can not use the character dash “-“, it will give obscure
error message if you have a variable name such as list-req, instead you should
make the variable name list_req, use underscore instead

3. For some reason, you will get a error if you have several try & catch block
inside one method. Make sure you put the throw exception line at the really last
block of try & catch, don’t throw exception before the last block.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>