Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 30 discussion

Actual exam question from Salesforce's CRT-450
Question #: 30
Topic #: 1
[All CRT-450 Questions]

An org has a single account named `˜NoContacts' that has no related contacts. Given the query:
List<Account> accounts = [Select ID, (Select ID, Name from Contacts) from Account where Name=`˜NoContacts'];
What is the result of running this Apex?

  • A. accounts[0].contacts is invalid Apex.
  • B. accounts[0].contacts is an empty Apex.
  • C. accounts[0].contacts is Null.
  • D. A QueryException is thrown.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Anterey
Highly Voted 4 years ago
it will result in an empty list, not an empty Apex
upvoted 17 times
HR444
3 years, 3 months ago
Yep! Just for others seeking more clarification, the question *answer* is written wrong. Should be: "C. accounts[0] contacts is an empty list."
upvoted 5 times
...
...
ABHI0O07
Most Recent 8 months ago
it should be empty apex list
upvoted 1 times
...
PriyankN
8 months, 3 weeks ago
18:24:31:015 USER_DEBUG [3]|DEBUG|() Correct Ans: B (it is an empty list)
upvoted 1 times
...
KylinKirin
1 year ago
it's actually an empty list but I got System.ListException: List index out of bounds: 0 first.Why is not A the Answer?
upvoted 1 times
...
charlottexiao
1 year ago
empty list in Apex : []
upvoted 1 times
...
ApexMike
2 years, 1 month ago
The answer should an empty list, C is still incorrect since empty list does't mean Null
upvoted 1 times
...
franciscopantojag
3 years, 2 months ago
Empty list instead of empty Apex
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...