Originally posted by sreenivasa majji:
Because abs() accepts double type variable/constant as an argument, you can pass any variable which can be casted into double. In this case, except byte, you can pass any primitive type data as an argument to abs().
Except byte, what's wrong with byte?
<code><pre>
public class Test
{
public static void main(
String[] args)
{
byte b = -32;
System.out.println(Math.abs(b));
}
}
Output:
32
</pre></code>
[This message has been edited by Jim Hall (edited December 18, 2001).]