Multiple choice technology programming languages

assertions can force which of the constraints ......

  1. pre conditions

  2. post conditions

  3. exceptions

  4. class invariants

Reveal answer Fill a bubble to check yourself
A,B,D Correct answer
Explanation

Assertions in Java are used to enforce internal correctness checks: preconditions (requirements before method execution), postconditions (guarantees after method execution), and class invariants (conditions that must always hold true). They are not for exception handling - that's what try-catch blocks are for. Assertions can be disabled at runtime, unlike normal exception handling.