Menu
Question Index
...

What will be the output of the following program?

public class FindMax {
    public static void main(String[] args) {
        int x = 10;
        int y = 20;
        double z = 19.5;
        System.out.print(Math.max(x, y) + " " + Math.max(x, z) + " " + Math.max(y, z));
    }
}


20.0 19.5 20.0
20 19.5 20.0
20 19.5 20
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Math Class - java.lang.Math

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App