Explain listiterator and methods in listiterator?



Explain listiterator and methods in listiterator?..

Answer / Deep Kumar Singh

ListIterator is an iterator for lists that allows both forward and backward traversal, along with the ability to insert and remove elements. It provides the following useful methods: add(E e) – inserts a new element into the list, before the current position. set(E e) – replaces the current element with a new element. next() – moves the cursor to the next element. previous() – moves the cursor to the previous element. hasNext() and hasPrevious() – checks if there is an available element to move forward or backward respectively. remove() – removes the current element from the list.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is externalizable?

1 Answers  


what is the difference between String and StringBuffer classes?

2 Answers   Infosys,


What is ‘is-a ‘ relationship in java?

1 Answers  


what is Portal(web based online portal)?

2 Answers   AIG,


What is a null point?

1 Answers  


What is the difference between JDBC 1.0 and JDBC 2.0?

1 Answers   Corent Technology,


How many bytes is 255 characters?

1 Answers  


What methods are called, When we navigate from one applet to another applet?

1 Answers  


1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?

3 Answers   TCS,


What does it mean that strings are immutable?

1 Answers  


List interface?

2 Answers  


What is the difference between private & public & friendly classes?

1 Answers  


Categories