Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Platform Developer I Topic 2 Question 111 Discussion

Actual exam question for Salesforce's Platform Developer I exam
Question #: 111
Topic #: 2
[All Platform Developer I Questions]

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?

Show Suggested Answer Hide Answer
Suggested Answer: A, B

Contribute your Thoughts:

Dorothy
2 months ago
Haha, C and D are like trying to light a match by just holding it. Gotta throw that exception!
upvoted 0 times
Ngoc
14 days ago
C) Haha, C and D are like trying to light a match by just holding it. Gotta throw that exception!
upvoted 0 times
...
Lisandra
15 days ago
B) throw new parityException ('parity does not match');
upvoted 0 times
...
Karl
24 days ago
A) throw new ParityException ();
upvoted 0 times
...
...
Darci
2 months ago
I agree with Elfriede and Benton. A and B are the right options here.
upvoted 0 times
Gianna
1 months ago
Yes, A and B are the correct options for firing the custom exception.
upvoted 0 times
...
Luann
2 months ago
I agree, B is also a valid way to throw the custom exception.
upvoted 0 times
...
Major
2 months ago
I think A is the correct way to fire the custom exception.
upvoted 0 times
...
...
Erick
2 months ago
I'm not sure, but I think the answer could also be B) throw new parityException('parity does not match').
upvoted 0 times
...
Benton
2 months ago
Definitely A and B. You need to use the 'throw' keyword to actually raise the exception.
upvoted 0 times
...
Adelaide
2 months ago
I agree with Patti, because throwing the exception is the correct way to handle errors.
upvoted 0 times
...
Elfriede
2 months ago
A and B are the correct ways to fire the custom exception. C and D don't actually throw the exception.
upvoted 0 times
Jade
1 months ago
D) new ParityException('parity does not match');
upvoted 0 times
...
Wilbert
1 months ago
C) new ParityException ();
upvoted 0 times
...
Frederick
2 months ago
B) throw new parityException ('parity does not match');
upvoted 0 times
...
Deja
2 months ago
A) throw new ParityException ();
upvoted 0 times
...
...
Patti
2 months ago
I think the answer is A) throw new ParityException();
upvoted 0 times
...

Save Cancel