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.



Leave a Reply 2

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


Anil

Anil

I think correct answer is A,B,D

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

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

lolwut?

lolwut?

It is, Anil.

Check the “Answer” Explanation where it says “A, E: Better to check if the index is within bounds”.

The fact that E was there instead of D tells me that the wrong letter was entered in the Answer section OR that selections D and E’s contents should’ve been switched.