Given:
3. public static void main(String[] args) { 4. try { /*from ww w. j av a2 s . c o m*/ 5. throw new Error(); 6. } 7. catch (Error e) { 8. try { throw new RuntimeException(); } 9. catch (Throwable t) { } 10. } 11. System.out.println("phew"); 12. }
Which are true? (Choose all that apply.)
A is correct.
It's legal to throw and handle errors and runtime exceptions.RuntimeException is a sub-subclass of Throwable.
B is incorrect because the code produces "phew".