end of day, done till 13
This commit is contained in:
23
experiments/Iterator10exp.java
Normal file
23
experiments/Iterator10exp.java
Normal file
@@ -0,0 +1,23 @@
|
||||
// exp
|
||||
import java.util.*;
|
||||
class Iterator10exp{
|
||||
public static void main(String args[]){
|
||||
ArrayList<String> nameList = new ArrayList<String>();
|
||||
nameList.add("Aditya");
|
||||
nameList.add("Vijay");
|
||||
nameList.add("Ravi");
|
||||
nameList.add("Ajay");
|
||||
|
||||
String name = "Ajay";
|
||||
String name2 = "Misa";
|
||||
|
||||
nameList.add(name2);
|
||||
nameList.remove(nameList.get(2));
|
||||
nameList.remove(name);
|
||||
|
||||
Iterator itr = nameList.iterator();
|
||||
while(itr.hasNext()){
|
||||
System.out.println(itr.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user