A short grumble

I came across this little oddity today with the way shorts are handled - the method looks like this:

public void someMethod(short s);

So I tried to call it like so:

c.someMethod(1);

Which doesn't compile! You have to add a cast to convert the integer down to a short:

c.someMethod((short) 1);

Which is kind of ugly. Oddly, the following does work:

short s = 1;

Go figure! And unlike with longs, floats or doubles, there appears to be no suffix that you can apply to tell the compiler it should be a short value. Annoying.


Comment Guidelines
See the FAQ for details on the full rules and guidelines. No Spam. Write clearly and thoughtfully - no bad language.