Hi All, Can we catch RuntimeException in our program? If we use,is there any performance issue? If it does not affect performance how to use it.Can any one explain me clearly. Thanks in advance. Venkat
Rahul Mahindrakar
Ranch Hand
Joined: Jul 28, 2000
Posts: 1825
posted
0
Hi Venkatesh, I dont think that RuntimeException affects performance. But catching it and logging it is helful for the maintaince to debug the problem that occured. Lets say for some reason an ArrayIndexOutOfBoundsException took place in your code. If you dont catch this RuntimeException and log it how will you come to know what problem has occured. BR Rahul
Mike Brock
Greenhorn
Joined: Dec 30, 2002
Posts: 15
posted
0
Originally posted by Rahul Mahindrakar: Hi Venkatesh, I dont think that RuntimeException affects performance. But catching it and logging it is helful for the maintaince to debug the problem that occured. Lets say for some reason an ArrayIndexOutOfBoundsException took place in your code. If you dont catch this RuntimeException and log it how will you come to know what problem has occured. BR Rahul
Well you will certainly know that an ArrayIndexOutOfBoundsException has occured, since all uncaught RuntimeExceptions will cause the JVM to exit. Mike.