Restrictions on Generics


Restrictions
  1. Cannot Instantiate Generic Types with Primitive Types
  2. Cannot Create Instances of Type Parameters
  3. Cannot Declare Static Fields Whose Types are Type Parameters
  4. Cannot Use Casts or instanceof With Parameterized Types
  5. Cannot Create Arrays of Parameterized Types
  6. Cannot Create, Catch, or Throw Objects of Parameterized Types
  7. Cannot Overload a Method Where the Formal Parameter Types of Each Overload Erase to the Same Raw Type


Link

0 comments:

Post a Comment

My Instagram