Java Runtime Exception is used to check un-checked exception. It is accepted standard that to sub class JavaRunTimeException. Can you please explain me the reason behind sub classing without directly using it as below.
try { int x = Integer.parseInt(args[0])/Integer.parseInt(args[0]); } catch (RuntimeException e) { } Recommended approach
public class ServiceFaultException extends RuntimeException {} try { int x = Integer.parseInt(args[0])/Integer.parseInt(args[0]); } catch (ServiceFaultException e) { } I would like to know reasons for this recommendation. ?