The rules for variable assignments do not apply to arguments passed to methods. I can remember that Dan's mock has an explanation about this... it seem the developers of
Java chose not to perform an implicit cast in values passed as arguments because it would be dificult to determine which method should be called in case of overloading. Imagine this scenario:
As you can see, problems may arise here if the implicit casting is performed in arguments to methos. The value of x fits in an int, but its type is a long.... what should the compiler do to determine the method the programmer wants to be called?
Stefan.
[ August 20, 2004: Message edited by: Stefan Guilhen ]
SCJP 1.4, SCBCD 1.3<br />IBM 141, 484, 486