Given the code fragment: What is the result?
A.
Result: 215 Result: 215
B.
Compilation fails
C.
Result: 235 Result: 215
D.
Result: 10 Result: 30
E.
Result: 10 Result: 25
Given the code fragment: What is the result?
A.
Result: 215 Result: 215
B.
Compilation fails
C.
Result: 235 Result: 215
D.
Result: 10 Result: 30
E.
Result: 10 Result: 25
C
Answer: D
Explanation:
In the first println the + operation is used for string concatenation so the printed value will be this one:
Result: 235
In the second println we see a * operation which will be executed before the string concatenation so as a result the printed value will be this one:
Result: 215