exception handling

why do we need a throw or clause when we have the catch blocksi m confused bt this concept can any body help me out .and differences between throw and throws
[171 byte] By [lingarajua] at [2007-10-1 3:54:09]
# 1

> why do we need a throw or clause when we have the

> catch blocks

> i m confused bt this concept can any body help me out

> .and differences between throw and throws

"throw" is like what idiots do in glass houses, only most thrown exceptions have a purpose.

Basically, "throw" means: something's gone wrong, crash my program unless somebody up the stack thought this might happen, catches it, and does something else.

"throws" is a tag for methods, to warn people up the stack to be prepared...

Adeodatusa at 2007-7-8 22:46:10 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 2

> why do we need a throw or clause when we have the

> catch blocks

> i m confused bt this concept can any body help me out

> .and differences between throw and throws

its simple if u want your own code to handle exceptions u try

and catch

them ...however if you want somebody else to do that (who so ever will be using that method) you can use throw

... that way you are not concealing any information ....see!!

moonchild666a at 2007-7-8 22:46:10 > top of Java-index,Other Topics,Java Community Process (JCP) Program...