New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce DEX-450 Exam - Topic 11 Question 89 Discussion

Actual exam question for Salesforce's DEX-450 exam
Question #: 89
Topic #: 11
[All DEX-450 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?

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: B, D

Contribute your Thoughts:

0/2000 characters
Jesse
3 months ago
"throw new ParityException('parity does not match');" is also valid!
upvoted 0 times
...
Lashon
3 months ago
Wait, can you really throw it without a message?
upvoted 0 times
...
Ty
3 months ago
Agree, "throw new ParityException();" is the way to go!
upvoted 0 times
...
Effie
4 months ago
I think "new ParityException();" alone won't work.
upvoted 0 times
...
Beula
4 months ago
You can definitely use "throw new ParityException();" to fire it.
upvoted 0 times
...
Fidelia
4 months ago
I’m not completely certain, but I think you need to use the throw keyword to actually fire the exception, so that makes me lean towards B and D.
upvoted 0 times
...
Kati
4 months ago
I feel like we practiced something similar where we had to throw custom exceptions, and I think both B and D might be the right answers.
upvoted 0 times
...
Ahmed
4 months ago
I think option B is definitely one way to throw the exception, but I'm a bit confused about whether option D is also correct.
upvoted 0 times
...
Whitley
5 months ago
I remember we discussed how to throw exceptions in our last study session, but I'm not entirely sure if option A is valid since it doesn't use the throw keyword.
upvoted 0 times
...
Sherita
5 months ago
I'm feeling pretty confident about this one. The two correct answers are B and D - throwing the exception with or without a custom message. I'll make sure to double-check my work, but I think I've got a good handle on how to fire this custom exception.
upvoted 0 times
...
Madonna
5 months ago
Hmm, I'm a little unsure about this one. I know we need to throw the exception, but I'm not sure if we need to include a message or not. I'll have to think this through carefully.
upvoted 0 times
...
Helga
5 months ago
This looks pretty straightforward. I think the two correct ways to fire the ParityException are B and D.
upvoted 0 times
...
Melvin
5 months ago
Okay, I've got this. The two ways to fire the exception are B) throw new ParityException('parity does not match'); and D) throw new ParityException();. The first one includes a custom message, while the second one just throws the exception without a message.
upvoted 0 times
...
Talia
5 months ago
Hmm, I'm a bit unsure about this one. I know the severity is important, but I'm not sure exactly what goes into that assessment. I'll have to think it through carefully.
upvoted 0 times
...
Terry
5 months ago
Okay, let me think this through. The key requirements are around restricting the device and application to only the necessary functionality for inventory management. I think option B, using a MAC security policy, could be a good way to achieve that.
upvoted 0 times
...
Malinda
2 years ago
True, so it's A and D then. A bit tricky but manageable once you think it through.
upvoted 0 times
...
Jamal
2 years ago
B looks correct but it has a string parameter which our custom exception doesn't handle.
upvoted 0 times
...
Edward
2 years ago
Ha! I guess the developer is really into parity. Maybe they should create a 'ParityMatchException' instead. But B and D are the correct answers.
upvoted 0 times
...
Lamonica
2 years ago
I think both B and D are correct. Depends on whether you want to include a custom message or not.
upvoted 0 times
Helga
2 years ago
B) throw new ParityException("parity does not match");
upvoted 0 times
...
Rusty
2 years ago
A) new ParityException();
upvoted 0 times
...
Lisha
2 years ago
B) throw new ParityException("parity does not match");
upvoted 0 times
...
Jose
2 years ago
B) throw new ParityException("parity does not match");
upvoted 0 times
...
Cortney
2 years ago
A) new ParityException();
upvoted 0 times
...
Kiera
2 years ago
A) new ParityException();
upvoted 0 times
...
...
Rossana
2 years ago
Good point. Actually, D seems right. Also, B looks like it might be okay?
upvoted 0 times
...
Ma
2 years ago
I agree with option D for sure. But isn't option A missing a throw keyword?
upvoted 0 times
...
Delsie
2 years ago
Option B is the way to go! Throwing the exception with a message is more informative for the caller.
upvoted 0 times
Hoa
2 years ago
B) throw new ParityException("parity does not match");
upvoted 0 times
...
Tawny
2 years ago
A) new ParityException();
upvoted 0 times
...
...
Jamal
2 years ago
Yup, throwing exceptions in Apex is important too. I'm leaning towards options A and D.
upvoted 0 times
...
Malinda
2 years ago
This question is quite technical. Understanding custom exceptions is crucial.
upvoted 0 times
...

Save Cancel