Menu
Question Index
...

What will be the output of the following program?

public class Balance {
    public static void main(String[] args) {
        float xBal = 10.0f;
        double yBal = 20.0;
        System.out.print("After loan x,y bal is ");
        System.out.print(Math.copySign(xBal, -yBal));
        System.out.print(" " + Math.copySign(-yBal, -xBal));
    }
}


After loan x,y bal is -10.0 -20.0
After loan x,y bal is -10.0 20.0
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