Online Java Compiler By
JavaTpoint.com
public class RintExample3 { public static void main(String[] args) { double x = 80.5; double y = 79.5; // rounds upto 80 which is the nearest even double value System.out.println(Math.rint(x)); System.out.println(Math.rint(y)); } }
Output