Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JAVA Which of the following is not an acceptable (according to good coding pract

ID: 3808225 • Letter: J

Question

JAVA

Which of the following is not an acceptable (according to good coding practice) use of exceptions? A routine might use exceptions to report invalid input values A routine might return an exception if it was given valid input but is unable to complete for some reason A routine that is already returning a value might use an exception to return end-of-file or other event that would be difficult to signal with a return code. A routine might use an exception to jump out of a loop during normal processing (non-error situation)

Explanation / Answer

d) Its not a good practice because we got no error scenarios

EXCEPTION are like abnormal situation that occurs in our code, we should not use exceptions for other cases. For Normal Termination we do not require exception, we require exception for unexpected input or abnormal termination.