Try this
import java.lang.Math.*;
public class Main
{
public static void main(
String[] args)
{
double bar = -2.7;
int foo;
//int foo = (int) Math.max(3);
// foo = (int) Math.min(2);
foo = (int) Math.abs(bar);
System.out.println(foo);
foo = (int) Math.ceil(bar);
System.out.println(foo);
foo = (int) Math.floor(bar);
System.out.println(foo);
foo = (int) Math.round(bar);
System.out.println(foo);
}
}
Try substituting 2.7 and try again, try uncommenting the commented out lines and see what's the error message.
Give a thought to the outputs.
The correct answer for your question would be foo = (int) Math.floor(bar);
Tell me why
Hope this helps...