math.floor java code example

Example 1: floor in java

Math.floor(value);

Example 2: math.floor

console.log(Math.floor(5.95));
// expected output: 5

console.log(Math.floor(5.05));
// expected output: 5

Example 3: math.floor

console.log(Math.floor(5.05));
// expected output: 5

Example 4: java math.floor

The floor of a floating point number is the largest integer that is <= to the number.

Example 5: java "->"

interface LambdaFunction {
    void call();
}
class FirstLambda {
    public static void main(String []args) {
        LambdaFunction lambdaFunction = () -> System.out.println("Hello world");
        lambdaFunction.call();
    }
}

Example 6: java "->"

Runnable r = ()-> System.out.print("Run method");

// is equivalent to

Runnable r = new Runnable() {
            @Override
            public void run() {
                System.out.print("Run method");
            }
        };

Tags:

Cpp Example