logo

NJP

Difference b/w hasNext() & next()

Import · Jan 13, 2023 · article

hasNext(): This method returns true if the iterator has more elements.

next(): This method returns the next element and also moves to the next element.

View original source

https://medium.com/@LearnITbyPrashant/difference-b-w-hasnext-next-5989a4edb8a7?source=rss-d005fc598f0a------2