class round{
public static void main(String[] argv){
System.out.println("" + Math.round(-2.9));
System.out.println("" + -2.9 + 0.5 );
System.out.println("" + Math.round(-2.9 + 0.5));
}
}
Gives you the output ...
-3
-2.90.5
-2
Hopefully you can figure it out from here ...