How to handle the runtime exceptions ?
This example shows how to handle the runtime exception in a java programs.
public class NeverCaught { static void f() { throw new RuntimeException("From f()"); } static void g() { f(); } public static void main(String[] args) { g(); } }
The above code sample will produce the following result.
From f()
Advertisement