Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {

        double d1 = 1.2, d2 = 34.5, d3 = 6.7;

        System.out.println("integer value closest to " + d1 + " = " + StrictMath.rint(d1));

        System.out.println("integer value closest to " + d2 + " = " + StrictMath.rint(d2));

        System.out.println("integer value closest to " + d3 + " = " + StrictMath.rint(d3));
    }
}