Generics what does actually mean? [duplicate]

<?> is a shorthand for <? extends Object>, it’s also known as an unbounded wildcard. So you can specify any type of object in your generic.

For example the List class is declared as List<?>, because it can be a list of anything you want.


Resources:

  • Effective java – Generics.pdf
  • Java language specification – Type Arguments and Wildcards
  • oracle.com – Java tutorials, wildcards

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)