?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Double Trouble: Equivalent Statements

APCSA-GPV4KW

Consider the following code segment.

double x = 19/5;
System.out.println(x);

Which of the following can replace the first line of code without changing the output?

A
double x = (double)(19/5);
B
double x = 19/(double)15;
C
double x = (double)19/5;
D
double x = 19/5.0;
E
double x = 19.0/5;