Wednesday, 15 February 2017

Math : RoundMethod

public class RoundMethod {

    public static void main(String args[]) {
        double d = 100.675;        double e = 100.500;        float f = 100;        float g = 91f;
        System.out.println(Math.round(d));        System.out.println(Math.round(e));        System.out.println(Math.round(f));        System.out.println(Math.round(g));    }
}

No comments:

Post a Comment