If I have a method
void f(byte b);
how can I call it with a numeric argument without casting?
f(0);
gives an error.
You cannot. A basic numeric constant is considered an integer (or long if followed by a "L"), so you must explicitly downcast it to a byte to pass it as a parameter. As far as I know there is no shortcut.
1.4m articles
1.4m replys
5 comments
57.0k users