aspose file tools
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: 3657

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

Joined: Oct 27, 2005
Posts: 19899

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
rocket mass heater kickstarter
subject: getClass and type reification?