What does Apex use to record disruptions in code execution?
Click on the arrows to vote for the correct answer
A. B. C. D.A.
Apex is an object-oriented programming language used in Salesforce development. Apex uses exceptions to record disruptions in code execution.
An exception is an event that occurs during the execution of code that disrupts the normal flow of the program. When an exception occurs, Apex creates an object of the Exception class to record information about the event. This object contains information such as the type of exception, the line number where the exception occurred, and any additional details that may be useful in diagnosing the problem.
In Apex, exceptions can be handled using try-catch blocks. The try block contains the code that may throw an exception, while the catch block contains the code that handles the exception. If an exception is thrown in the try block, execution immediately jumps to the catch block, and the Exception object is passed to the catch block for handling.
The addError method is used to add custom error messages to sObjects, and is not related to recording disruptions in code execution. Primitive types are basic data types such as Integer, String, and Boolean, and are not related to recording exceptions.
Therefore, the correct answer to the question is A. Exceptions.