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
Author

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
Bartender

Joined: Sep 20, 2010
Posts: 3649
    
  17

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

Joined: Oct 27, 2005
Posts: 19785
    
  20

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getClass and type reification?