Limited access

Upgrade to access all content for this subject

If a method is called in violation of a precondition, which of the following is a good choice for the action to be taken?

A

Reformat the hard drive.

B

Print a warning message to System.out.

C

Perform the calculation assuming the precondition is true.

D

Throw an exception.

E

Halt execution of the program.

Select an assignment template