Salesforce Platform Developer I (legacy) — Question 32
Which three statements are true regarding custom exceptions in Apex? (Choose three.)
Answer options
- A. A custom exception class must extend the system Exception class.
- B. A custom exception class can implement one or many interfaces.
- C. A custom exception class cannot contain member variables or methods.
- D. A custom exception class name must end with ג€Exceptionג€.
- E. A custom exception class can extend other classes besides the Exception class.
Correct answer: A, B, D
Explanation
The correct answer includes A, B, and D because a custom exception must extend the Exception class, can implement interfaces, and should be named with an 'Exception' suffix. Option C is incorrect because a custom exception can indeed have member variables and methods, and option E is also wrong as custom exceptions must directly extend the Exception class.