Multiple choice technology programming languages

Identify the type parameter which can be used to use all numeric types in a generic call.

  1. Integer

  2. Float

  3. Number

  4. Double

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

In Java generics, the Number type parameter can be used to accept all numeric types (Integer, Float, Double, etc.) because Number is the superclass of all numeric wrapper classes. Option C is correct because Number provides the common base for numeric generics. Options A, B, and D are specific types that would only work with their respective types, not all numeric types.