Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

override hash set and equals problem

843789Sep 8 2010 — edited Sep 8 2010
Hello,
this my code:
 class A {
	public Map<String,Integer> names = new LinkedHashMap<String, Integer>(); 
	public Map<Var, Integer> paramList = new LinkedHashMap<Var, Integer>();
}
//main
Map<A, Set<B>> map t = new LinkedHashMap<A, Set<B>>();
I did the override for A for all two maps but for my aims, two objects A are the same even when they have the same key String of names (doens't matter Integer).
How can I change the override, please? Is it an override problem I suppose.
thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2010
Added on Sep 8 2010
13 comments
192 views