Boolean function not working and only printing out false

I have created a code that takes a linked list and is supposed to compare it with a new one. There is no problem with my Test.java code but my main code does not seem to be printing out false. Here is what I have so far with my Boolean code.

public boolean equals (Object obj) {

if (this == obj)

return true;

if (obj == null)

return false;

if (getClass() != obj.getClass())

return false;

SList otherList = (SList) obj;

if (numElements != otherList.numElements)

return false;

LLNode node = list;

LLNode otherNode = otherList.list;

return true;...

Read More »

By: StackOverFlow - Wednesday, 19 September

Related Posts