wood burning stoves
The moose likes Java in General and the fly likes getClass and type reification? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "getClass and type reification?" Watch "getClass and type reification?" New topic

getClass and type reification?

Tapio Niemela
Ranch Hand

Joined: Jan 06, 2006
Posts: 77
I'm reading "Java generics and collections" by Maurice Naftalin & Philip Wadler. I'm having trouble understanding the following sentence on page 101. "The restrictions on class tokens lead to useful property. Wherever a type of the form Class<T> appears, the type T should be a reifiable type"

However I'm allowed to do following:

where <? extends String>isn't reifiable type (as parameterized types with bound are not reifiable) , so either the quoted sentence isn't true or I have misunderstood something

Also I'm not allowed to do following

where <String> actually is reifiable type. So, please help me to understand the sentence..

Stephan van Hulst

Joined: Sep 20, 2010
Posts: 4627

Would you please quote the context for those that don't have the book?

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20275

That example doesn't make it exactly clear because the reference type and object type match. Consider this better example:

How To Ask Questions How To Answer Questions
I agree. Here's the link: http://aspose.com/file-tools
subject: getClass and type reification?
jQuery in Action, 3rd edition