?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Using Both Numbers and Strings in a Statement

APCSA-T6XGWI

Which of the following segments of code will print 75.2 to the console?

A
double num = 75.0;
String str = "" + num + 0.2;
System.out.println(str);
B
int num = 75;
String str = num + 0.2;
System.out.println(str);
C
double num = 75.0;
String str = ("" + num) + 0.2;
System.out.println(str);
D
String num = "75.0";
String str = num + 0.2;
System.out.println(str);
E
double num = 75.0;
String str = "" + (num + 0.2);
System.out.println(str);