GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generics and collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Generics and collections" Watch "Generics and collections" New topic
Author

Generics and collections

Mabetha Chokwe
Greenhorn

Joined: Aug 13, 2009
Posts: 1
can any 1 give me the basic concept of Generics and collections
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
That topic goes far too deep to put it in a nutshell. But let me try ...

Collections are classes that hold an array of objects for you. They enhance the behavior of traditional Arrays in adding functionality and convenience.

Prior to Java 5, Collections could not be typed. You could stuff any object into a collection, and upon retrieval, you needed to cast it back to the initial object type.
This is error-prone and also cumbersome.
Generics allow you to parameterize your collection and hence make it type safe.

E.g.



JDBCSupport - An easy to use, light-weight JDBC framework -
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Howdy Mabetha, welcome to javaranch

It is tough to cover those two massive topics that easily. Here are a few resources that can be useful (these are just tutorials I found on google)

http://java.sun.com/docs/books/tutorial/collections/intro/index.html

http://www.javaworld.com/jw-11-1998/jw-11-collections.html

http://www.allappforum.com/java/java_collection_framework.htm


http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html

http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf

You can also buy this book on this topic...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Yewint Ko
Ranch Hand

Joined: Aug 02, 2009
Posts: 90
Hi Mabetha!
You'd better find out some books. There are too much concept you need for Generics and Collection framework .Visit www.freecomputerbooks.com to find some books.
 
GeeCON Prague 2014
 
subject: Generics and collections