Ask a Question
Advertise on boostr.in
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
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>?
Sep 7, 2015
to add a comment.
Related Hot Questions
Government Jobs Opening