What's wrong with this print-iterable method?
Posted
by Tom Brito
on Stack Overflow
See other posts from Stack Overflow
or by Tom Brito
Published on 2010-06-08T14:41:12Z
Indexed on
2010/06/08
14:52 UTC
Read the original article
Hit count: 166
java
private static void printIterable(Iterable iterable) {
// ERROR: "Type mismatch: cannot convert from element type Object to Iterable"
for (Iterable i : iterable) {
System.out.println(i);
}
}
What the compiler is talking about? Its an Iterable, not an Object.
© Stack Overflow or respective owner