I will go with option A for this one.
To call a method with an sObject parameter, you need to pass an instance of a specific sObject type, such as Account, Contact, or Opportunity2. Based on this, I think the correct answer is A. processList (acc), where acc is an instance of Account sObject.
Example:
List<sObject> myList = new List<sObject>();
myList.add(new Account(Name = 'Acme', Phone = '111-111-1111'));
myList.add(new Account(Name = 'Beta', Phone = '222-222-2222'));
static void processList(List<sObject> input) {
for (sObject obj : input) {
Account acc = (Account) obj;
System.debug('Name: ' + acc.Name + ', Phone: ' + acc.Phone);
}
}
processList(myList);
Seems that something was missed in the answers.
BC is not correct answers, but there's no invocation of the processList method in D.
On the other hand, it's possible to name list as 'acc' (List<Account> acc;)
upvoted 3 times
...
...
Log in to ExamTopics
Sign in:
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.
FriedConsole2000
9 months, 1 week agomoitam
1 year, 2 months agoRonin192
2 years agoskipper009
2 years, 9 months agolorenac2
1 year, 10 months agonibbio
2 years, 11 months agodrwebber
2 years, 11 months ago