Given the following code snippet, which specific exception will be thrown?
final Object exception = new Exception(); final Exception data = (RuntimeException)exception; System.out.print(data);
A.
Although this code uses the RuntimeException and Exception classes, the question is about casting.
Exception is not a subclass of RuntimeException, so the assignment on the second line throws a ClassCastException at runtime, making Option A correct.