[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Technical Discussion :: Java

66. What is an Iterator ? How do you traverse through a collection using its Iterator?

Answer:

Iterator allows to traverse the collection and also it has methods which enables to obatin or remove elements. ListIterator adds the feature of traversing the list bi-directionally, also modify the elememts.



Eg.: Iterator itr = al.iterator();



       while(itr.hasNext()) {}

Asked In :: iGate Syntel Inc. Accenture

Post Your Answer Here:

Name *
Email
Alert me

Post Your Reply Here:

Report Error

Please Login First Click Here

Post Your Reply Here:

Report Error

Please Login First Click Here