If you run following code then it will compile and run successfully,
public class Example { public static void main(String[] args) { // insert code here try { new Example().go(); // throw new OutOfMemoryError(); } catch (Error e) { System.out.println(e); } } void go() { go(); } } With following output :
java.lang.StackOverflowError So my question is "Can we catch an Error"..??