This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Generics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Generics " Watch "Generics " New topic
Author

Generics

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 659

"One of the notable features of Java generics is the erasure of generic types in the virtual
machine. Perhaps surprisingly, the erased classes still retain some faint memory of their
generic origin
"
Core Java Vol I (8th Ed) P. 641

Somehow this reminds me of weak references, is this correct?
Can we read this information somehow?

Related links?
1. Weak references
2. Understanding weak references


Jon
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13868
    
  10

No, this does not at all have anything to do with weak references.

Is there some more context in the book? (I don't have the book so I can't look it up).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3362
    
    9
I assume it has to do with the fact that when you compile the code, the bytecode still knows that it is generic, so if you write new code that interacts with this compiled class, it will be able to perform type safety checks, as opposed to compiled code that used raw types. All the erasure actually takes place right before run time. This is when all generic information is discarded.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generics
 
Similar Threads
Generics
Generics
Generics
Generics
generics