rint() Method in java

Java Programming Language Number Class in java (Article) Number Class in java (Program)

971

Program:

public class WrapperrintMethod {


      public static void main(String args[]) {
	       double d = 300.675;
	       double e = 200.500;
	       double f = 100.200;

	       System.out.println(Math.rint(d));
	       System.out.println(Math.rint(e));
	       System.out.println(Math.rint(f));
	    }
}

/*

Returns the integer that is closest in 
value to the argument. Returned as a double.
*/

Output:

301.0
200.0
100.0
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.