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
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: 3986
    
  18

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
Sheriff

Joined: Oct 27, 2005
Posts: 20078
    
  30

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 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
Have you checked out Aspose?
 
subject: getClass and type reification?
 
It's not a secret anymore!