Throwable wen given in a catch block............

what does that mean wen we give a Throwable in a catch block instead of Exception in it.... is there any difference in giving both.. does it affects in any way giving it to catch block............ plz can any one tell this..............
[243 byte] By [ms_chaitraa] at [2007-11-26 18:16:22]
# 1
It means bad programming (as does catching Exception) http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Throwable.html
YoGeea at 2007-7-9 5:49:56 > top of Java-index,Java Essentials,Java Programming...
# 2
Take a look at the inheritance tree. Exception extends Throwable, so a catch block which is catching throwables will catch exceptions and errors. (Error do not extend Exception)Kaj
kajbja at 2007-7-9 5:49:56 > top of Java-index,Java Essentials,Java Programming...
# 3
java.lang.Throwable is the parent of java.lang.Exception and java.lang.Error.
prometheuzza at 2007-7-9 5:49:56 > top of Java-index,Java Essentials,Java Programming...
# 4
kk thanx i went thru that..wat i understood is.. if i give this Exception in the catch block then i can catch only those exceptions not the errors..so if i need to catch this error then i have to put Throwable in the catch block even its bad practise..
ms_chaitraa at 2007-7-9 5:49:56 > top of Java-index,Java Essentials,Java Programming...
# 5

> kk thanx i went thru that..wat i understood is.. if i

> give this Exception in the catch block then i can

> catch only those exceptions not the errors..so if i

> need to catch this error then i have to put Throwable

> in the catch block even its bad practise..

I have only caught Throwables 4-5 times in 10 years so it's not something which you do often.

Kaj

kajbja at 2007-7-9 5:49:56 > top of Java-index,Java Essentials,Java Programming...
# 6

first u need to understand the difference between exception and error as i think u are confused with them make it clear

Exceptions are caused by programs thus writing efficient program a program can control them

Error : they are not in the hand of programmers

like system failure, jvm terminates etc

please go through the document again...

bye

rakesh_thakura at 2007-7-9 5:49:56 > top of Java-index,Java Essentials,Java Programming...