0

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.

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by redflame777
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.