Hello everyone..
In this session let us look at the 'List Iterator' Concept.So far we've seen to iterate over an arraylist or linkedlist quickly to retrieve the elements..We can use the modified for loop, the special for loop saying for each element, in the collection of elements and then retrieve the values, but say we want to do some more operations when we iterate like, Add the values or update existing values or remove the existing elements from the list. So to do all these methods when we iterate over a list.. List Iterator is very useful. Let us see how we can create the list iterator object here and let us see how we can iterate over a list in the given order and in the reverse order. So that is also possible when you use a list iterator you can iterate over a list in the reverse order as well. So let's create a list iterator... so list iterator which is the interface over here. The object name, let me give it as itr and then list which is the name of the object that we're using an list.listiterator.. So itr will be created as a list iterator object and we need to import the list iterator from Java.util Now using this itr object and next, has next, previous and has previous methods. We can iterate over in the given order or in the reverse order..Now next will give us the next value in the list. Now when you create the list iterator by default the cursor is set before the beginning of the list. So say cursor is automatically set before the beginning and when you say list has next element it'll say yes there is next element available and then when you ask for the next element it'll give you the next. So for example if you do something like while itr.hasNext and run the loop until the list has next element available, list will run from the head to tail of the elements. Now as I set in the beginning cursor is before the first element.
=============================================================================
Subscribe for More Advantage :
https://www.youtube.com/c/Everythings...
To Learn Lava please watch playlist video :
• Full JAVA Tutorials
To Learn selenium watch playlist video :
• Full Selenium Tutorials
=====================
Watch Now :
=====================
How TO create maven Project : • how to create maven project in eclipse || ...
How configure selenium WebDriver in maven Project : • Configure selenium WebDriver with maven ||...
How to download chrome driver from selenium HQ : • How To download chrome driver from seleniu...
How To get Page Title and How to navigate page title : • selenium Basic setup And How To get Page T...
HTML Basic Tutorials : • Basic HTML || What is the element in Web P...
===========================================================
Java string Tutorials part 1 : • JAVA String Tutorial Part 1 || Trim || Upp...
java string Tutorials part2 : • Sting JAVA Tutorial Part 2 || String equ...
String slice operation : • String Slice Operation || How can You Reve...
String Search operation : • String Search operation in JAVA || conta...
String replace operation : • string replace operation || String JAVA Tu...
String builder Methods : • Stringbuilder Methods in java || what is t...
String builder class : • Stringbuilder class in java || what is str...
static Keyword in java : • Static Keyword in java || what is static k...
opps classes : • What is Class And Object in JAVA || Object...
Data Encapsulation : • Data Encapsulation in java || Data Hiding ...
opps practical work : • Hands on Exercise 2 on Class and object ||...
======================
Follow on Twitter : / everythingspro
Follow on Instragram : / everythingsactivity
Follow on Facebook : / everythingsprogrammingactivity
========================
#listIterator #listiteratorinjava #javatutorial #Everythingsprogrammingactivity #everythingsprogrammingactivity #everythings #programming #activity #onlinejavaclass #freejavaclass #onlinefreejava
In questa pagina del sito puoi guardare il video online What is List Iterator in java || java tutorials || List Iterator || della durata di ore minuti seconda in buona qualità , che l'utente ha caricato EverythingsProgramming Activity 13 gennaio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 69 volte e gli è piaciuto 5 spettatori. Buona visione!