Salesforce Platform Developer I (legacy) — Question 245
Which two number expressions evaluate correctly? (Choose two.)
Answer options
- A. Double d = 3.14159;
- B. Integer I = 3.14159;
- C. Decimal d = 3.14159;
- D. Long l = 3.14159;
Correct answer: A, C
Explanation
The correct answers are A and C because 'Double' and 'Decimal' types can represent decimal values, such as 3.14159, accurately. In contrast, 'Integer' and 'Long' types are designed for whole numbers, thus they cannot store decimal values.