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 |
What is externalizable?
what is the difference between String and StringBuffer classes?
What is ‘is-a ‘ relationship in java?
what is Portal(web based online portal)?
What is a null point?
What is the difference between JDBC 1.0 and JDBC 2.0?
How many bytes is 255 characters?
What methods are called, When we navigate from one applet to another applet?
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?
What does it mean that strings are immutable?
List interface?
What is the difference between private & public & friendly classes?