Professional Documents
Culture Documents
CFW 2
CFW 2
CFW 2
==========================================
ex:
===
import java.util.ArrayList;
import java.util.ListIterator;
import java.util.Scanner;
// store
al.add(101); //0
al.add("ravi");//1
al.add(10000.00f);//2
al.add("ravi@gmail.com");//3
al.add(102); //4
al.add("rani");//5
al.add(20000.00f);//6
al.add("rani@gmail.com");//7
al.add(101);
al.add("raju");
al.add(30000.00f);
al.add("raju@gmail.com");
al.add(5, "uuuuudash");
System.out.println(" after al is :"+al);
al.remove(7);
System.out.println(" after al is :"+al);
// Login App
String id;
if(al.contains(id))
{
System.out.println(" loged sucess");
}
else
{
System.out.println(" FAIL ");
}
// fetching operations..
System.out.println("==============");
for(; ll.hasNext();)
{
System.out.println( ll.next());
System.out.println("==============");
for(; ll.hasPrevious();)
{
System.out.println( ll.previous());
}
}
impnotes:
========
when we are working with Database operation, then should required retriving
operation...
B. public E next();
=============================
it return element, object if the iterator has element, object..
=> according to the above 2 methods... , then using iterator we can fetch
element, object from CFW in only forword direction..
B. public E next();
it return true.. if the iterator has element, object .. else it return false..
in previous direction
D. public E previous();
=======================
it return element, object if the iterator has element, object.. in previous
direction..
=> according to the above 4 methods... , then using Listiterator we can fetch
element, object from CFW in both forword and previous direction..
=====================================