As per the below diagram, except for interface Iterable, all the remaining constructs (interface / class / abstract class) sit in same package java.util Why does Iterable sit in java.langpackage?Note: The intention is to understand the packaging aspect of java programming.
Packaging structure of Java collections (java.util) - why does Iterable sit in java.lang?
java;api;packages;collections
As explained in its javadoc, the purpose of Iterable is to support particular language syntax:Implementing this interface allows an object to be the target of the foreach statementAs such, it belongs to the lang package, whichProvides classes that are fundamental to the design of the Java programming language.Other classes at the diagram belong to JCF and hence, are in the util package whichContains the collections framework...