Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. ArrayList<Person> peopleList;
  2. ArrayList<Place> placeList;
  3.  
  4. public static void sort(ArrayList list){
  5. sortList(list);
  6. }
  7. public static void sortList(ArrayList<Comparable> list)
  8. {
  9. //Code here
  10. }
  11.  
  12. public static void sort(ArrayList<Comparable> list){
  13. sortList(list);
  14. }
  15.  
  16. Error:(59, 14) java: method sort in class Sorts cannot be applied to given types;
  17. required: java.util.ArrayList<java.lang.Comparable>
  18. found: java.util.ArrayList<Passenger>
  19. reason: actual argument java.util.ArrayList<Passenger> cannot be converted to java.util.ArrayList<java.lang.Comparable> by method invocation conversion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement