This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Custom Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Custom Exception" Watch "Custom Exception" New topic
Author

Custom Exception

priyanaka jaiswal
Ranch Hand

Joined: Jun 03, 2011
Posts: 79
Hi All,

Can we write our own custom Exception by extending RuntimeException?
N Sahni
Ranch Hand

Joined: Jul 07, 2011
Posts: 55

Yes we can extend RuntimeException and build our own custom exception.

For more details you can refer: http://www.coderanch.com/t/376608/java/java/Why-extend-RuntimeException


Thanks and Regards,
Nilesh Sahni | nsahni@infocepts.com | www.infocepts.com
Vijay Tidake
Ranch Hand

Joined: Nov 04, 2008
Posts: 146

Hi,

yes can write the custom exception by extending RuntimeException as well as Exception.

Thanks.


The important thing is not to stop questioning.Curiosity has its own reason for existing.
 
Consider Paul's rocket mass heater.
 
subject: Custom Exception