aspose file tools
The moose likes Java in General and the fly likes What is the difference, templates generics Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "What is the difference, templates generics" Watch "What is the difference, templates generics" New topic
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
    
  66

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the difference, templates generics
 
Similar Threads
generics
Generics
Generics
Generics
Generics