@Override
public boolean add( Object o )
{
return super.add( o );
// Sorts arraylist
Collections.sort(this, new Comparator<Object>() {
// code here
}
});
}
}
As you can see, I am trying to @Override the method add, found in the superclass, and implement Collections.sort() in the subclass. I have added a comparator to help implement this however, it says that the code is unreachable.
Any suggestions would be appreciated.