• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getClass and type reification?

 
Tapio Niemela
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 6128
74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you please quote the context for those that don't have the book?
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That example doesn't make it exactly clear because the reference type and object type match. Consider this better example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic