• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

collections framework

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone give a good refrence for collections framework
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/j2se/1.4.2/docs/api/
 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shandilya popuru:
can anyone give a good refrence for collections framework



Here you go
Lists
Set
Map
Collections class

Collection Java Sun Tutorial

HTH
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK , Let me try this ...

Collection - interface

It has two sub interface :

1] List
2] Set

List has three sub classes :
1] ArrayList
2] LinkedList
3] Vector

Set has two direct sub class :
1] HashSet
2] LinkedHashset

Set also has one indirect sub class , I mean to say it has a interface SortedSet & it has one sub class TreeSet .

Now come to Map , Although we call it collection but it has no relation with Collection .

Map - interface

It has 3 direct classes :

1] Hashtable
2] HashMap
3] LinkedHashMap

It also has one interface SortedMap that has one sub class TreeMap ( same like TreeSet )

Now total we have 10 collections . I am explaning all 10 in short , if you want more detail then specify that , I will again try to provide ...

All List has index-value pair . So all are ordered by index .
1] ArrayList => growable array , nothing special in this .
2] Vector => same as ArrayList but all the methods are synchronized in this case .
3] LinkedList => if you read data structure in your syllabus then probably you would be familiar with this . All element has two link , one is towords right element & one is towords left element .

Set just store one object in one row , no pair ( index-value , key-value ) type of thing in this . you can think like it just store values . They doesn't allow duplications .
1] HashSet => nothing special , not sorted , no order .
2] LinkedHashSet => not sorted ( only TreeSet is sorted ) yes but you can retrive values with insertion order or last access order .
3] TreeSet => sorted .

Map have key-value pair in one row . both are object . key should be unique in Map .
1] HashMap => nothing special , not sorted , no order .
2] Hashtable => same as HashMap , but mthods are synchronized here .
3] LinkedHashMap => same as LinkedHashSet , maintain order .
4] SortedMap => sorted .

Some Twos :
1] two collection have synchronized method :
Vector , Hashtable ( both were in 1.2 also )
2] two collection are sorted :
TreeSet , TreeMap

One Three :

3] three collection have elements that have two link :
LinkedList , LinkedHashSet , LinkedHashMap

I hope I didn't miss anything important in this . If missed then please put ...
[ February 04, 2005: Message edited by: rathi ji ]
 
shandilya popuru
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
great explanation rathi ji

and the links provided by jay pawar were really helpful

thanks a lot, i was weak in collections framework and k&b doesnt go into the implementation of them or the api, those links had everything i wanted
 
Jay Pawar
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shandilya popuru:
great explanation rathi ji

and the links provided by jay pawar were really helpful

thanks a lot, i was weak in collections framework and k&b doesnt go into the implementation of them or the api, those links had everything i wanted



Honestly... , if you are just targeting to clear the SCJP 1.4 exam. K&B book is more than sufficient. You do not have to memorize the API for each of the interface.
Just keep in mind Set do not allow duplicates and List do.
The table in the collection chapter of K&B book is all you should know to tackle the questions in the exam.

The links I provided will definitely give you more knowledge than what is intended for clearing the exam. The choice is yours..

Hope that helps
 
Jay Pawar
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by rathi ji:

LinkedList , LinkedHashSet ( Please any body confirm about LinkedHashMap )




LinkedHashMap maintains a doubly-linked list of the entries. The order is usually in which the keys were inserted ( insertion-order ). This implementation is not synchronized.

 
shandilya popuru
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks jay
i was worried about it cos i found questions related to api in some of the mocks
 
No holds barred. And no bars holed. Except this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic