Can some one help me with the sort fuction problem I am having? I do not know how to fix it. It compiles right but will not run. Here is what I have so far:
public int compareTo(Object p)
{
final Product o = (Product)p; // make it a product
return (this.getName().compareToIgnoreCase(o.getName())); // compare names
}
I am pretty sure this is where the problem is. what am I doing wrong in the compareTo section of my program class.
Please help. This is on my final due in 2 hours from now. any help would be greatly appreciated. The rest of my code has worked fine until I got to this point.