Which three are bad practices?

Which three are bad practices?

Which three are bad practices?

A.
Checking for ArrayIndexOutOfBoundsException when iterating through an array to determine when all elements have been visited

B.
Checking for Error and if necessary, restarting the program to ensure that users are unaware problems

C.
Checking for FileNotFoundException to inform a user that a filename entered is not valid

D.
Checking for ArrayIndexOutOfBoundsExcepcion and ensuring that the program can recover if one occur

E.
Checking for an IOException and ensuring that the program can recover if one occurs

Explanation:
A, E: Better to check if the index is within bounds.
B: Restarting the program would not be a good practice. It should be done as a last possibility only.
Incorrect answers:
Checking for FileNotFoundException and IOException exceptions are good practices.



Leave a Reply 5

Your email address will not be published. Required fields are marked *


lolwut?

lolwut?

The “Explanation”(Answer) for the answer apparently has a typo.

It should be (A, D:) instead of (A, E:).

Jazz

Jazz

A,B,E are bad practise

Explanation:

A – Better to check if the index is within bounds.
B – restarting is a last possibility that should be done.
E – Better to check if the index is within bounds.

James

James

The Answer is A, B, D.