Multiple choice technology programming languages

Why does an Assert class that checks program assertions need several implementations of its assert method?

  1. The Java language has loose type checking

  2. The Java language has tight type checking

  3. To keep tabs on garbage collection

  4. You never know how many you need, so you should always cover the most obvious cases

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Because Java is a strongly (or tightly) typed language, methods cannot accept arbitrary types without explicit definitions. To allow assertions on different data types (like integers, booleans, floats, and objects), the Assert class must provide multiple overloaded implementations of its assertion methods.