I'm trying to learn java better and I got one question.
Say I got two collections, an ArrayList and a LinkedHashSet. Is it possible to make a function like this:
void print(collection c) {
for (object tmp:c) {
System.out.println(tmp);
}
}
Watch your capitalization:
private void printCollection(Collection collection) {
for (Object obj : collection) {
System.out.println(obj);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With