Re: hashmap

From: TT \(Tom Tempelaere\) (_N_OSPAMtiti_____at_hotmail.comMAPSO_N_)
Date: 01/30/04


Date: Fri, 30 Jan 2004 08:40:19 GMT


"Øyvind" <anonymous@a.xxx> wrote in message
news:binSb.428$_c4.6160@news4.e.nsc.no...
> I have a hashmap.
>
> The class 'Person' has two subclasses named 'Man' and 'Woman'. If I put
for
> example an instance of Woman into the hashmap. -->
myhashmap.put(key,woman)
> and get it later by using Person person = (Person) myhashmap.get(key)
>
>
> will I then get the data for Woman too, or do I only get the data for
> Person?
>

A bit off-topic, but wouldn't gender be a property of your class? Agreed,
man & women differ from a person's point of view, but usually little from a
software point of view.

Tom.