EXPLAIN THIS PLEASE

why is it that when I do this

ll.add(ht.get(key,arraylist));

I get the following display result

size 31

nextnull

nextnull

nextnull

nextnull

nextnull

nextnull

nextnull

nextnull

nextnull

next [Ace of Hearts, 4 of Spades]

next [Ace of Hearts, 4 of Spades, 2 of Spades]

next [Ace of Hearts, 4 of Spades, 2 of Spades, King of Hearts]

next [Ace of Hearts, 4 of Spades, King of Hearts]

nextnull

nextnull

next [Ace of Hearts, 4 of Spades, 4 of Hearts, 2 of Spades]

nextnull

nextnull

nextnull

nextnull

nextnull

nextnull

nextnull

nextnull

next [4 of Spades]

next [4 of Spades, 2 of Spades]

next [4 of Spades, 2 of Spades, King of Hearts]

next [4 of Spades, King of Hearts]

nextnull

nextnull

next [4 of Spades, 4 of Hearts, 2 of Spades]

but if I do this

ht.get(key,arraylist);

ll.add(key);

I get the following result(this is what I needed)

size 31

next [7 of Hearts]

next [Jack of Hearts]

next [Ace of Hearts, Jack of Hearts]

next [Ace of Hearts, 4 of Spades, Jack of Hearts]

next [7 of Hearts, Ace of Clubs, Ace of Hearts, 4 of Spades, Jack of Hearts]

next [7 of Hearts, Ace of Clubs, Ace of Hearts, Jack of Hearts]

next [4 of Spades, Jack of Hearts]

next [7 of Hearts, Ace of Hearts, 4 of Spades, Jack of Hearts]

next [7 of Hearts, Ace of Hearts, Jack of Hearts]

next [Jack of Hearts]

next [4 of Spades, Jack of Hearts]

next [7 of Hearts, Ace of Hearts, 4 of Spades, Jack of Hearts]

next [7 of Hearts, Ace of Hearts, Jack of Hearts]

next [7 of Hearts, 4 of Spades]

next [7 of Hearts, 4 of Spades, Jack of Hearts]

next [7 of Hearts, Jack of Hearts]

next [Ace of Hearts]

next [Ace of Clubs, Ace of Hearts]

next [Ace of Clubs, Ace of Hearts, 4 of Spades]

next [Ace of Clubs, Ace of Hearts, 4 of Spades, Jack of Hearts]

next [Ace of Clubs, Ace of Hearts, Jack of Hearts]

next [Ace of Hearts, 4 of Spades]

next [Ace of Hearts, 4 of Spades, Jack of Hearts]

next [Ace of Hearts, Jack of Hearts]

next [Ace of Hearts]

next [Ace of Hearts, 4 of Spades]

next [Ace of Hearts, 4 of Spades, Jack of Hearts]

next [Ace of Hearts, Jack of Hearts]

next [4 of Spades]

next [4 of Spades, Jack of Hearts]

next [Jack of Hearts]

please explain

[3300 byte] By [zainuluk] at [2007-9-27 0:27:40]
# 1
I don't have enough info to really answer this, but it may be because of a casting problem.Does ht.get return a key?
mistwing at 2007-7-4 15:56:07 > top of Java-index,Archived Forums,Java Programming...
# 2
The difference:In case A) you're adding the VALUE for the given KEY in your ht (Hashtable?).In case B) you're adding the KEY itself.;)
lachp at 2007-7-4 15:56:07 > top of Java-index,Archived Forums,Java Programming...
# 3
ht.get(key,arraylist); ht isn't a Hashtable - wrong number of args for get method.
beggarstune at 2007-7-4 15:56:07 > top of Java-index,Archived Forums,Java Programming...
# 4
...right, didn't read it carefully enough, sorry.- Still, our problem persists, we haven't a clue yet what type ht and ll are of... :(
lachp at 2007-7-4 15:56:07 > top of Java-index,Archived Forums,Java Programming...