1.

How Do You Optimize Exceptions?

Answer»

• Be specific while handling the exception in your catch block.
• Be specific while THROWING exception in your throws clause.
• Do not use Exception Handling to control programming flow.
• Very little overhead is imposed by using exception handling MECHANISM unless an exception occurs or thrown a new exception object explicitly.
• Always use the finally block to release the resources to PREVENT resource LEAKS.
• Handle exceptions locally wherever POSSIBLE.
• Do not use Exception handling in loops.

• Be specific while handling the exception in your catch block.
• Be specific while throwing exception in your throws clause.
• Do not use Exception Handling to control programming flow.
• Very little overhead is imposed by using exception handling mechanism unless an exception occurs or thrown a new exception object explicitly.
• Always use the finally block to release the resources to prevent resource leaks.
• Handle exceptions locally wherever possible.
• Do not use Exception handling in loops.



Discussion

No Comment Found