equals() method in arraylist

can somebody pl help me ..why the following code is not workinf ...returns the false value even though the strings are same

public boolean equals()

{

if (!(obj instanceof ArrayCollection))

return false;

ArrayCollection myArray = (ArrayCollection)obj; // cast obj to an ArrayCollection

if (myArray.mySize != mySize )

return false;

for (int i = 0; i < mySize; i++)

if (myArray.equals (myStorage))

return true;

//return false;

[507 byte] By [sidharthwa] at [2007-10-2 1:57:37]
# 1
Please continue in your original thread: http://forum.java.sun.com/thread.jspa?threadID=671048Please go there and repaste your code, using the [code] and [/code] tags (see button above posting box), so that you don't get italics.
MLRona at 2007-7-15 19:38:46 > top of Java-index,Java Essentials,New To Java...
# 2

public boolean equals()

Cut and paste your code, rather than retyping it. Post it between [code] and [/code] tags. Please post a [url=http://www.physci.org/codes/sscce.jsp]short, concise, executable example[/url] of what you're trying to do. This does not have to be the actual code you are using. Write a small example that demonstrates your intent, and only that. Wrap the code in a class and give it a main method that runs it - if we can just copy and paste the code into a text file, compile it and run it without any changes, then we can be sure that we haven't made incorrect assumptions about how you are using it.

yawmarka at 2007-7-15 19:38:46 > top of Java-index,Java Essentials,New To Java...