Salesforce Platform Developer I (legacy) — Question 225
In a single record, a user selects multiple values from a multi-select picklist.
How are the selected values represented in Apex?
Answer options
- A. As a List<String> with each value as an element in the list
- B. As a String with each value separated by a comma
- C. As a String with each value separated by a semicolon
- D. As a Set<String> with each value as an element in the set
Correct answer: C
Explanation
The correct answer is C because in Apex, the values selected from a multi-select picklist are represented as a single String where each value is separated by a semicolon. Options A and D suggest different data structures that do not accurately reflect the representation used for multi-select picklists, while option B incorrectly uses a comma as the separator.