A developer creates a custom exception as shown below:
public class ParityException extends Exception { }
What are two ways the developer can fire the exception in Apex?
Throwing Exceptions in Apex:
throw new ExceptionType();creates a new instance and throws it.
A: No argument constructor.
B: Constructor with a custom error message.
Why Not Other Options?
C and D: These create exception instances but do not throw them, which is not valid syntax for firing an exception.
Eliseo
21 hours agoRose
6 days ago