Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
medium

Math Method Chaining

Mark
< Prev
Next >

Calculate the final integer output by applying standard Math class methods to a negative integer value.

What is printed when the following Java program is compiled and run?

public class QuestionTrace {

    public static void main(String[] args) {
        int x = -9;
        double y = Math.sqrt(Math.abs(x) + 16);
        int z = (int) Math.pow(y, 2);
        System.out.println(z - 10);
    }
}
A

25

B

35

C

5

D

15

Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|