I have been studying for the exam and I started doing some practice tests.
I came across something I haven't seen before (multiple and interface casts) and I am having difficulty finding anything about it online.
Identify options that will compile and run without error.
What are the rules for multiple casts? How do I go about deciphering those?
Enthuware Software Support
Joined: Sep 23, 2000
Interface cast works exactly the same as a class cast and a multiple cast is not much different from a single one. You should break a multiple into two single casts as shown below:
b = (B)(I) a;
is same as:
I temp = (I) a;
b = (B) temp;
Now, if you know single casts, there should be no issue with the above