What exception type does the following program throw? public class Quiz2D { public static void main(String[] args) { Object object = new Object(); String string = (String) object; } }
What exception type does the following program throw?
public class Quiz2D
{
public static void main(String[] args)
{
Object object = new Object();
String string = (String) object;
}
}
options:
| ClassCastException |
| StringIndexOutOfBoundsException |
| ArithmeticException |
| No exception |