我想编写一个函数printAll(),该函数仅接受那些实现了Iterable的元素,以便我可以对其进行迭代并打印这些元素。我怎么做? 最佳答案 public static void printAll(final Iterable<?> toIterate)。