Guess the output!
public class Main
{
public static Object iWannaThrowThings()
{
String tString = null;
try
{
tString = "A";
Object tObject = tString;
Integer tInteger = (Integer) tObject;
return tInteger;
}
catch (ClassCastException ex)
{
throw ex;
}
finally
{
return tString;
}
}
public static void main(String [] args)
{
System.out.println(iWannaThrowThings());
}
}
Is it:
a) A
b) 65
c) Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
d) 42
Answer: (a) !
#