Sobes.tech
Junior — Middle

All standard collections in programming language originate from which class?

sobes.tech AI

Answer from AI

In Java, all standard collections inherit from the java.util.Collection interface. This is a basic interface that is extended by other collections such as List, Set, and Queue. It defines fundamental methods for working with groups of objects, such as adding, removing, checking for the presence of elements, and obtaining the size of the collection.

Example:

import java.util.ArrayList;
import java.util.Collection;

Collection<String> coll = new ArrayList<>();
coll.add("item");
int size = coll.size();