Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


whats the difference between raw types unbounded wild cards and using object i using -'java,generics,effective-java'


whats the difference between raw types unbounded wild cards and using object i  using -'java,generics,effective-java'

I am reading the chapter on Generics in Effective Java.

Help me understand difference between Set, Set<?> and Set<Object>?

The following paragraph is taken from the book.


  As a quick review, Set<Object> is a parameterized type representing a
  set   that can contain objects of any type, Set<?> is a wildcard type
  representing  a set that can contain only objects of some unknown
  type, and Set is a raw type, which opts out of the generic type
  system.


What is meant by "some unknown type"? Are all unknown types of type Object? In that case what is the specific difference between Set<?> and Set<Object>?
    

asked Sep 7, 2015 by rajesh
0 votes
5 views



Related Hot Questions



Government Jobs Opening


...