Salesforce Certified Platform Developer II — Question 79

A developer has written the following method:
static void processList(List<sobject> input){
Which code block can be used to call the method?

Answer options

Correct answer: D

Explanation

The correct answer is D because it iterates over a query result for Account objects and provides a list of sObject type to the method. Option A is incorrect as it tries to pass a single variable instead of a list. Option B and C both attempt to use methods that return a different type than what is expected by the method's parameter.