posted 18 years ago
Thanks for referencing Dan's question, it is always good to see the original question.
Well, Short.MIN_VALUE is -32768 is a short and that's converted to an int value of -32768. Then the int Math.abs(int) method is called on -32768 returning an int value 32768, and that's not Short.MIN_VALUE. That is, Math.abs only returns an int, long, float, or double. It does not return a short.