Question: Which two of these statements about errors in Java are true? An alternative to throwing exceptions from a method can be to anticipate potential problems
Which two of these statements about errors in Java are true?

An alternative to throwing exceptions from a method can be to anticipate potential problems and provide alternative paths of code to deal with different situations that arise when the code is executed A try-catch statement can be used to prevent an exception being propagated on the call stack. An alternative to throwing an exception is to use a try-catch statement to signal that a problem has occurred. Throwing exceptions is always the best way to deal with errors that may occur when a program runs Defensive programming is ideal for situations where potential errors are unpredictable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
