• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generics and Collections  RSS feed

 
Chris Ringer
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The purpose of Generics is to only allow a specific class of objects to stored in a given collection concrete class. For example, I can define an ArrayList so that only objects of my class Foo call be added. So, why in the world did Sun call this Generics? Why wasn't it called Specifics? Just wondering...

The Wikipedia definition of generic is "Generic generally means pertaining or appropriate to large classes or groups as opposed to specific".

Chris
 
Henry Wong
author
Sheriff
Posts: 23284
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On that wiki page provided by you, click the "generic programming" link, for the definition of Generic as it applies to programming.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!