In java integer literals are type int and floating point literals are type double. Apparently, all the compiler knows is that you're passing an int to a method that requires a byte and that this "could" be a problem. The same thing happens with a double being passed to a method that accepts floats above.
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
posted
0
This is from the Java Language Specification 5.3.
Method invocation conversions specifically do not include the implicit narrowing of integer constants which is part of assignment conversion (�5.2). The designers of the Java programming language felt that including these implicit narrowing conversions would add additional complexity to the overloaded method matching resolution process (�15.12.2).
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.