New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce DEX-450 Exam - Topic 4 Question 36 Discussion

Actual exam question for Salesforce's DEX-450 exam
Question #: 36
Topic #: 4
[All DEX-450 Questions]

Given:

Map<ID, Account> accountMap = new Map>ID, Account> ([SELECT Id, Name FROM Account]);

What are three valid Apex loop structures for iterating through items in the collection? (Choose three.)

Show Suggested Answer Hide Answer
Suggested Answer: A, B, C

Contribute your Thoughts:

0/2000 characters
Roselle
4 months ago
Wait, are we sure about B? Can you really loop through values like that?
upvoted 0 times
...
Lasandra
4 months ago
E looks wrong too, keySet() gives IDs, not Account records.
upvoted 0 times
...
Toi
4 months ago
D seems off, you can't iterate a Map directly like that.
upvoted 0 times
...
Dorsey
4 months ago
C is not valid, you can't use an index with a Map.
upvoted 0 times
...
Jutta
4 months ago
A and B are definitely valid!
upvoted 0 times
...
Elly
5 months ago
I practiced a similar question, and I believe option B should work because it lets us loop through the values directly.
upvoted 0 times
...
Hui
5 months ago
I'm a bit unsure about option C; I remember we can't use a traditional for loop like that with a Map, right?
upvoted 0 times
...
Sage
5 months ago
I think option A is definitely valid since we're iterating over the keys of the map.
upvoted 0 times
...
Aimee
5 months ago
I feel like option D is incorrect, but I'm not completely sure why. Can we iterate over a map like that?
upvoted 0 times
...
Kiley
5 months ago
The AP failover priority seems like the most straightforward answer. I'll go with that unless I spot something else that seems more likely.
upvoted 0 times
...
Venita
5 months ago
Hmm, this looks like a tricky one. I'll need to think through the possible causes carefully.
upvoted 0 times
...

Save Cancel