-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_91.java
More file actions
30 lines (30 loc) · 787 Bytes
/
Main_91.java
File metadata and controls
30 lines (30 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.*;
public class Main_91 {
public static void main(String[] args) {
ArrayList<Integer> l1= new ArrayList<>();
ArrayList<Integer> l2= new ArrayList<>(5);
l2.add(234);
l2.add(594);
l2.add(718);
l1.add(6);
l1.add(89);
l1.add(67);
l1.add(32);
l1.add(5);
l1.addAll(l2);
System.out.println("L1 is");
for(int i: l1){
System.out.println(i);
}
int i=0;
System.out.println("l2 is");
while(i<3){
System.out.println(l2.get(i));
i++;
}
System.out.println(l1.contains(27));
System.out.println(l1.indexOf(238));
l1.remove(4);
System.out.println(l1.contains(5));
}
}