There are many scenarios in enterprise application development where you would use RuntimeException instead of Exception. Following are two such scenarios that are pretty common:
- While implementing Exception handling as an aspect (separating the concern design principle), in most modern day frameworks you would declarative handle exceptions and associate specific exception handling blocks rather than hardcoding the same. One good example of this is JDBC template in Spring that converts all the SQL exceptions to RuntimeException so developer doesnot write try catch blocks while writting data access logic. you can define exception handler declaratively that can provide different behavior in dev env. and different behavior in production. Similar implementation is there in Struts 1.x Action class also, where the execute method is declared to throw Exception and there is separate ExceptionHandler mapped in struts-config for handling specific exceptions. Though this is not example of RuntimeException but the design principle is same to separate the concern of normal execution and exception handling.
- Another use of RuntimeException is in EJB and other Transaction Managers where in the transactions are controller by container. In such containers by convention if you throw RuntimeException from within your code the transaction would rollback - the same would not happen if you throw an Exception.
These are 2 significant scenarios that immediately come to my mind but there would be other scenarios of-course.