----- Original Message -----
Sent: Tuesday, March 12, 2002 5:04
PM
Subject: Re: OffTopic - strange
overloaded method behaviour
Hi
Sourabh,
'value' is declared as an 'Object' so
validate((Tag)tag,value) will resolve to
validate(Tag,object).
Regards
Sameer
The invoking code is in the same class. The
relevant part is given below
.........
String tagname,
msg;
Object value, tag;
Map.Entry
entry;
tag = tagMap.get(tagname);
.......
file://if not null and valid, then remove it from the
valuesMap and send for writing
if ((tag != null)
&& (value != null) && validate((Tag) tag, value))
{
}
I am having an entry in the map as "name"=Float
. At execution time, I expected the method validate(Tag, Number) to be
invoked rather than validate(Tag, Object). But I observed that validate(Tag,
Object) was invoked. I am confused by this behaviour. Am I missing something
?
TIA,
-sourabh
----
Sourabh Kulkarni
Embedded Systems
Group.
rapidEffect (P) Ltd.25,Napier Road, Pune 411 001
Tel./Fax.
+91-20-6363250