This is a discussion on generics casting - Java ; hi, I'm trying to cast a LinkedList<EdgePoint> to Iterable<DiagramElement>. Just casting by (Iterable<DiagramElement>)list results in an error. However I think it should be possible as: - LinkedList implements Iterable - EdgePoint implements DiagramElement Is there anyone who knows how to ...
hi,
I'm trying to cast a LinkedList<EdgePoint> to Iterable<DiagramElement>.
Just casting by (Iterable<DiagramElement>)list results in an error.
However I think it should be possible as:
- LinkedList implements Iterable
- EdgePoint implements DiagramElement
Is there anyone who knows how to solve this?
thanks