I recognize the problem inherant in our comparisons - however, I have to
be the wet blanket again and offer a counter-example that would result
in confusing results (to me, anyway) :

public class Test
{
    public static void main( String arg[] )
    {
        Double left = new Double( "2.1");
        Double right = new Double( "2.0");
        
        if(( left instanceof Number) && (right instanceof Number))
        {            
            int leftValue  = ((Number)left).intValue();
            int rightValue = ((Number)right).intValue();
            
            System.out.println( "Result :" + (leftValue == rightValue));
        }
    }
}

you will see for the output

   Result: true

when clearly they are not equal.  Again, I am not suggesting there
aren't problems - however, I can offer the above example of one problem
that arises when using Number over Integer...

geir

[Snipped off patches for the bandwidth-impaired...]

-- 
Geir Magnusson Jr.                           [EMAIL PROTECTED]
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Reply via email to