problem with TreeMap - element removal fails.
- From: "tomek milewski" <milewski.tomasz@xxxxxxxxx>
- Date: 17 Jul 2006 01:53:13 -0700
Hello,
I can't solve some problem. I'm looking for mistake in my thinking or
any walkaround.
There is some sample code:
import java.util.TreeMap;
class A {
public A() {
}
public static final void main(String[] args) {
A a = new A();
TreeMap<A, Integer> map = new TreeMap<A, Integer>();
map.put(a, new Integer(1));
map.remove(a);
}
}
Executing last line of this code throws ClassCastException. Why element
can be putted into this TreeMap and can't be removed? I've been trying
some solutions but none has worked :( .
Thank You for any answer.
--
Pozdrawiam,
Tomasz Milewski
.
- Follow-Ups:
- Re: problem with TreeMap - element removal fails.
- From: Chris Uppal
- Re: problem with TreeMap - element removal fails.
- From: Ingo R. Homann
- Re: problem with TreeMap - element removal fails.
- Prev by Date: J2EE Localization with WAS
- Next by Date: Re: Browser time vs Server Time.
- Previous by thread: J2EE Localization with WAS
- Next by thread: Re: problem with TreeMap - element removal fails.
- Index(es):