@Override
public String toString()
//toString method - returns the items on the stack
{
String s = "The stack is \n";
LLNode<T> currNode = top;
while(currNode != null)
{
s = s + currNode.getInfo() + "\n";
currNode = currNode.getLink();
}
return s;
}
System.out.println(list);
prints the toString in the class list was created from.
System.out.println(list);
prints the toString in the class list was created from.System.out.println(list.highBidder);
prints the variable highBidder found in the class list was created from.