IntelliJ Java IDE
The moose likes Performance and the fly likes Usage of RuntimeException in our program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "Usage of RuntimeException in our program" Watch "Usage of RuntimeException in our program" New topic
Author

Usage of RuntimeException in our program

Venkatesh Rajendran
Ranch Hand

Joined: May 17, 2001
Posts: 59
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
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
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.
 
 
subject: Usage of RuntimeException in our program
 
Threads others viewed
Time Triggered events in Javascript
main with static
performance degradation in using try/catch
access right to Static key word - same jvm - difference application
Layout design...
MyEclipse, The Clear Choice