Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
2 views
by (1.5k points)

1 Answer

0 votes
by (1.4k points)

Iterable: 

An Iterable represents a collection which can be traversed.  

Implementing the Iterable interface allows an object to make use of for-each loop. 

  • It does that by internally calling the iterator () method on the object. 

Iterator:  

An Iterator, on the other hand, is an interface which allows us to iterate over some other object which can be a collection of any kind. 

To iterate over an Iterator, we use hasNext() + next() methods in a while loop. 

Related questions

Browse Categories

...