posted 17 years ago
Hi guys,
Could you please help me with the following question :
What is the difference between the rules for method-call conversion and the rules for assignment conversion?
A. There is no difference; the rules are the same.
B. Method-call conversion supports narrowing, assignment conversion does not.
C. Assignment conversion supports narrowing, method-call conversion does not.
D. Method-call conversion supports narrowing if the method declares that it throws ClassCastException.
According to the author the correct choice is A, but I chose C.
I think the rules are different when aplied to method-call conversion and simple assignment conversion.
Here is my explanation :
As per my preceeding code, it's proved that conversion rules(I mean, narrowing) are different when aplied to method-call and simple assignment sentence.
Any comments would be highly appreciated.
Thanks.
"If someone asks you to do something you don't know how to, don't tell I don't know, tell I can learn instead." - Myself