Q1. What are the differences between Iterator<T> Vs Iterable<T>?
A1. The “Iterable” was introduced to be able to use in the “foreach” loop. A class implementing the Iterable interface can be iterated over. For example,
Hence, it can be used in the foreach loop
The Iterable interface has one method iterator()
So,…