Hi Sameer,
    Doesn't the actual type of object come into picture here?
-sourabh
----- 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
-----Original Message-----
From: Sourabh Kulkarni [mailto:[EMAIL PROTECTED]]
Sent: 12 March 2002 11:02
To: [EMAIL PROTECTED]
Subject: OffTopic - strange overloaded method behaviour

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)) {
        file://do something
    }
 
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
 

Reply via email to