Salesforce Certified Platform Developer II — Question 124

A developer has created a Visualforce page that uses a third-party JavaScript framework. The developer has decided to supply data to the JavaScript functions using JavaScript Remoting for Apex Controllers.
What is the correct syntax to declare a remote method in Apex? (Choose two.)

Answer options

Correct answer: A, C

Explanation

The correct syntax for declaring a remote method in Apex requires both the @RemoteAction annotation and the method to be static. Therefore, options A and C are correct as they both include the 'static' keyword. Options B and D are incorrect because B lacks the static modifier and D uses the wrong annotation, @RemoteObject, which is not valid for remote methods.