I'm currently tutoring a high school student in AP Java and she asked me a question about "double casting". I did not ever hear of this term before, but apparently her teacher expects her to know it for their upcoming final.
The example her teacher provided was if you wanted to cast an Integer into a String, you would have to do the following to not get a compiler error:
Integer i = new Integer(5);
String s = (String)(Object) i;
The question is: when would you want to do this in real life?
The teacher only provided examples which result in a run time error. Also, I never really knew there was a term for this, but it just seems like a bad idea to do it because there's only an error when the two types are incompatible.
Thanks!