Question: In a chunk of code where something can go wrong, what can you do to help protect the program from crashing? Select all that apply.

In a chunk of code where something can go wrong, what can you do to help protect the program from crashing? Select all that apply.

Ensure the method containing this chunk of code contains the "protected" access modifier.

Place the chunk of code into a "try" block, and add a "catch" block to do something different if an exception occurs.

Create an "exception" block and place this chunk of code into it. Add a "throw" block afterward to do something different if an exception occurs.

Use if/else statements to ensure certain lines of code do not execute if it would lead to an exception or error.


Step by Step Solution

3.37 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The detailed answer for the above question is provided be... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Business Communication Questions!