Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Forvirrende bruk av ... i metodekall-eksemplet, i forhold til Person... children

...

Code Block
languagejava
Person grandmother = ...Person()
Collection<Person> grandchildren = new ArrayList<Person>();
// Person.getChildren() returns the children as a Collection 
for (Person child : grandmother.getChildren()) {
	// Collection.addAll takes another Collection as its only argument
	grandchildren.addAll(child.getChildren());
}

...