Forums Register Login

Java might be unneccessarily difficult

+Pie Number of slices to send: Send

[ August 19, 2003: Message edited by: Barkat Mardhani ]
+Pie Number of slices to send: Send
I believe it is to enforce programmer responsibility in order to eliminate coding errors. It can also be easily solved by thus:
+Pie Number of slices to send: Send
I understand that. But what is the logic behind implicit cast arbitarily in some place and not in other place. It just makes language more difficult without any benifit in MHO.
Barkat
+Pie Number of slices to send: Send
The JLS explains why the designers of the language decided not to allow implicit narrowing of integer constants in method invocation conversions. JLS 5.3 Method Invocation Conversion
The rules for overloaded method resolution would be more complex otherwise.
+Pie Number of slices to send: Send
Thanks Marlene. That makes sense.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 480 times.
Similar Threads
Float and Byte
something odd with boxing/widening I can't figure out
why I cann't assign FINAL INT to Byte
Byte b = new Byte(123); //fails to compile ! :mad:
Question about byte
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:52:56.