Log In Register

Units


Iterators - Questions and Answers

 

Practice these Iterators under Java Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Iterators for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Iterators of Java Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge Java Programming specifically Iterators.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Iterators under Java Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Iterators topic of Java Programming:

 

1.  Which of these methods can be used to move to next element in a collection?

Answer: Option A

Explanation:

2. Which of these is a method of ListIterator used to obtain index of previous element?

Answer: Option B

Explanation:
 previousIndex() returns index of previous element. if there is no previous element then -1 is returned.

3. Which of these methods is used to obtain an iterator to the start of collection?

Answer: Option D

Explanation:
To obtain an iterator to the start of the start of the collection we use iterator() method.

4. Which of these iterators can be used only with List?

Answer: Option B

Explanation:

5. Which of these return type of hasNext() method of an iterator?

Answer: Option C

Explanation:
hasNext() returns boolean values true or false.

6. Which of these exceptions is thrown by remover() method?

Answer: Option D

Explanation: