nerdexam
Salesforce

CRT-450 · Question #228

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? Choose 2 answers

The correct answer is B. throw new ParityException("parity does not match"); D. throw new ParityException(). See the full explanation below for the reasoning.

Question

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? Choose 2 answers

Options

  • Anew ParityException();:
  • Bthrow new ParityException("parity does not match");
  • Cnew ParityException('parity does not match');
  • Dthrow new ParityException();

How the community answered

(20 responses)
  • A
    5% (1)
  • B
    80% (16)
  • C
    15% (3)

Community Discussion

No community discussion yet for this question.

Full CRT-450 Practice