Hi,
I'm trying to use the contains method of ArrayList but with no success. My application is this: I'm trying to work through a maze by creating my own stack object and pushing locations onto the stack and then backtracking or popping of locations when I get jammed in a corner with no way out.
So, I have a class called CS127BStack which has a method called contains. Here's the contains method:
You'll notice that I commented out the first try at just using ArrayList's built in contains method. Both ways didn't work.
The LocDirObject that this method refers to is another class I made which holds a row number, a column number and a
String (one character really).
Here's that code:
It compiles and runs but always gives me false for whether the stack contains a specific LocDirObject even if I have just pushed it onto the stack.
[ March 20, 2005: Message edited by: Patricia Smith ]