The Java Collections Framework (JCF) is a set of classes and interfaces that implement commonly reusable collection data structures. The JCF is part of the Java Standard Library, which provides data structures and algorithms for storing and manipulating groups of objects. It is a unified architecture for representing and manipulating collections, allowing collections to be manipulated independently of the details of their representation.
import java.util.Collection;import java.util.ArrayList;public class CollectionExample { public static void main(String[] args) { Collection<String> collection = new ArrayList<>(); collection.add("Apple"); collection.add("Banana"); collection.add("Orange"); for (String fruit : collection) { System.out.println(fruit); } }}Apple
Banana
Orange