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.
C and E are good practices => ABD arebad practices
The “Explanation”(Answer) for the answer apparently has a typo.
It should be (A, D:) instead of (A, E:).
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.
The Answer is A, B, D.
A, B, D.