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 x = 123456.7;
        double y = -123.45;

        // print the next number for x towards y
        System.out.println("Math.nextAfter(" + x + "," + y + ")=" + Math.nextAfter(x, y));

        // print the next number for y towards x
        System.out.println("Math.nextAfter(" + y + "," + x + ")=" + Math.nextAfter(y, x));

    }
}