Home »
MCQs »
Java MCQs
What will be the output of following Java code (6)?
80. What will be the output of following Java code?
public class Main {
public static void main(String[] args) {
System.out.println(Math.copySign(100.6, -200.6));
}
}
- 100.6
- -100.6
- -200.6
- 200.6
Answer: B) -100.6
Explanation:
The Math.copySign() returns the first floating-point argument with the sign of the second floating-point argument.