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) {

        float x = 12345.123f;
        float y = 123.123456f;

        // print the next floating numbers towards positive infinity
        System.out.println("Math.nextUp(" + x + ")=" + Math.nextUp(x));
        System.out.println("Math.nextUp(" + y + ")=" + Math.nextUp(y));

    }
}