java.lang.Math.round(double a) java.lang.Math.rint(double a) java.lang.Math.round(float a) java.lang.Math.round(double a) package com.codingdict; import java.lang.*; public class MathDemo { public static void main(String[] args) { // get two double numbers double x = 1654.9874; double y = -9765.134; // find the closest long for these doubles System.out.println("Math.round(" + x + ")=" + Math.round(x)); System.out.println("Math.round(" + y + ")=" + Math.round(y)); } } java.lang.Math.rint(double a) java.lang.Math.round(float a)