1

What is the difference between List<T> and List<?> ?

I found this type of code when I was going through java doc but couldn't understand the difference.

Idos
  • 15,053
  • 14
  • 60
  • 75
  • 4
    I have actually answered this exact question extensively here http://stackoverflow.com/questions/34993626/java-generics-objects-and-wildcards-differences-clarifications/34993866#34993866 making this a duplicate – Idos Feb 10 '16 at 19:07
  • 1
    Nice link @Idos I never knew that, good question too bad it's a duplicate :) – JimLohse Feb 10 '16 at 19:11
  • then whats that mean Comparable extends T> ? – user5533204 Feb 10 '16 at 19:19
  • @user5533204 it means something that implemented the `Comparable` interface with a type that `extends` the generic `T` type – Idos Feb 10 '16 at 19:21
  • can u please elaborate? may be with practical example – user5533204 Feb 10 '16 at 19:24
  • I could, but not here since this question is already closed. Maybe look a little online and in Stack Overflow, and if you don't find an answer then open a new question and I'll answer there ;) – Idos Feb 10 '16 at 19:25
  • k no problem :) thnx anyways – user5533204 Feb 10 '16 at 19:31

0 Answers0