?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Difficult

Numeric Data Type Casting in Arithmetic Statement

APCSA-LMFNW6

Consider the following code segment.

System.out.print((double) (10 / 4) * (int) 10.0 / 4 + (double) 10 / 4);

What is printed as a result of executing the code segment?

A

6.5

B

7.0

C

7.5

D

8.25

E

8.75