I have 3 classes.
Class A has an ArrayList of class B and class B has an ArrayList of class C.
Within Class A, I have a function called contain
public boolean contain(int t, String n)
{
for(int i = st.size() - 1; i >= 0; i--)
{
if(st.get(i).contain(t, n))
return true;
} //find a variable starting from the most recent entries
return false; //not found
} //contain()
within class B, I also have a function called contain
public boolean contain(int t, String n)
{
return symTable.contains(new Variable(t, n));
} //contain()
Class C is Variable()
What is happening is that symTable.contains(new Variable(t, n)); would return false even though it finds a matching object. I walked through the debugger and can confirm that the object that I am trying to find is in the list. Here is a screen shot at the point where the two objects did a comparison which yield false for some reason.
http://img146.imageshack.us/f/68863099.png/
obj would be the one that is in my ArrayList while this would be the object that I created in class B's contain function.
What exactly am I doing wrong? Thanks