How to Use Math.round() in Java


In this example, we will learn you how to use math.round() in Java.

Source Code

package com.beginner.examples;

public class Round {
  public static void main(String[] args) {
      System.out.println(Math.round(11.3)); // use math.round()
  }
}

Output:

11
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments