| Author |
What is the difference, templates generics
|
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3359
|
|
Hi. What is the difference between templates and generics ? (I have C++ background) thanks.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
John, Templates are more closely tied to a specific type. So if you want to use a template with two types, you end up with two copies in memory. Generics can be used with any type. If you want to use a generic with two types, you only have one copy in memory.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: What is the difference, templates generics
|
|
|