Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public class LListSent<T> implements Iterable<T>{
  2. //...
  3. public T get(int pos) {
  4. //...
  5. }
  6. //...
  7. private class LListSentIterator {
  8. private final LListSent list;
  9. private int currPos;
  10. private LListSentIterator(LListSent list) {
  11. this.list = list;
  12. currPos = 0;
  13. }
  14. //...
  15. @Override
  16. public T next() {
  17. return list.get(currPos++); //exception in this line
  18. }
  19. }
  20. }
  21.  
  22. incompatible Type: Object cannot be converted to T
  23. where T is a type-variable:
  24. T extends Object declared in class LListSent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement