Username: Password:
Not registered yet? Click Here
Search
Title/Subject only
Title -and- text
Home
Forums
Articles
Resources
Software Forums: Display Message

Author: Sohrab Saran
E-mail: [email protected]
Date: 2/2/2003 3:10:21 AM
Subject: 'equals' overriden for string array? How?
Message: public class testEquals
{
    public static void main(String[] args)
    {
        String[] sarr1 = new String[2];
        String[] sarr2 = new String[2];
        sarr1[0]="00--";
        sarr2[0]="00--";
        sarr1[1]="1";
        sarr2[1]="1";
        //sarr1[2]="";-out of bounds
        System.out.println(sarr1.equals(sarr2));
    }
}

I am getting output false whereas I expect true. Why?

You must be logged in to post a reply...

Back to the Folder



 Java -- Anything related to Java...
 'equals' overriden for string array? How? by Sohrab Saran  at 2/2/2003 3:10:21 AM
© 2002 - SoftwareForum.org - All Rights Reserved ...A software developer's forum