Multiple choice technology programming languages

To declare a bounded type parameter, which keyword is used ?

  1. implements

  2. use

  3. extends

  4. extend

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

Java uses the 'extends' keyword to declare bounded type parameters in generics, regardless of whether you're bounding to a class or interface. This creates an upper bound - the type parameter must be the specified type or a subclass. 'implements' is used for class declarations, not type parameters. 'extend' is a common misspelling - the keyword is 'extends'.