exam questions

Exam DEV-501 All Questions

View all questions & answers for the DEV-501 exam

Exam DEV-501 topic 1 question 151 discussion

Actual exam question from Salesforce's DEV-501
Question #: 151
Topic #: 1
[All DEV-501 Questions]

A developer can use optional catch statements for any exception type in a try-catch block. However, the general exception type, 'Exception', must only be used by the last catch() block.
EXAMPLE:
try{
// Some risky code.
}
catch(SomeExceptionType e){
// Handle one exception type.
}
catch(SomeOtherExceptionType e){
// Handle another exception type.
}
catch(Exception e){
// This must be the last catch block.
}
~|~
(Select all that apply)

  • A. Make calls to methods using both valid and invalid inputs.
  • B. In the case of conditional logic (including ternary operators), execute each branch of code logic.
  • C. Only test code using the System Administrator profile.
  • D. Focus solely on test coverage percentage score.
  • E. Complete successfully without throwing any exceptions, unless those errors are expected and caught in a try...catch block.
  • F. None of these
Show Suggested Answer Hide Answer
Suggested Answer: ABE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...