Comparator not found?

You have to pass an object of the comparator.

You have to pass an object of the comparator: Collections. Sort(ordbyauthor, new OpereComparatorAuthor()); Update: This is just a suggestion. Instead of defining a class, use anonymous class (which I think is a good candidate) for this kind of situation.E.g.

//I am using Sala here instead of Opera as per your comment Collections. Sort(ordbyauthor, new Comparator(){ @Override public int compare(Sala left, Sala right) { //do your comparision here according to your requirement //then return the result } }).

After having create the object I receive the error: cannot find symbol symbol : method sort(java.util. LinkedList,OpereComparatorAuthor) location: class java.util. Collections Collections.

Sort(ordbyauthor,new OpereComparatorAuthor()); – Mazzy Dec 15 '11 at 20:03 How are you declaring ordbyauthor? That comparator is not for Sala, it's for Opera as you have implements Comparator. You are passing list of Salas and Comparator for Opera.

The list and comparator should be for the same type either both for Sala or both for Opera. –? Dec 15 '11 at 20:07 1 Your Comparator is a Comparator.It compares Opera instances.

You're trying to use it to sort a List. Use a Comparator to compare Sala instances. – JB Nizet Dec 15 '11 at 20:08.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions