How to Create a Method that only accepts elements that implement Iterable
I want to write a function printAll(), which accepts only those elements that implement 开发者_开发知识库that implement Iterable so that I can iterate over them and print the elements. How do I do that?
public static void printAll(final Iterable<?> toIterate)
.
精彩评论