-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_92.java
More file actions
35 lines (35 loc) · 947 Bytes
/
Main_92.java
File metadata and controls
35 lines (35 loc) · 947 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
31
32
33
34
35
import java.util.*;
public class Main_92 {
public static void main(String[] args) {
LinkedList<Integer> l1= new LinkedList<>();
LinkedList<Integer> l2= new LinkedList<>();
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);
l1.addLast(899);
System.out.println("L1 is:");
for(int i: l1){
System.out.print(i);
System.out.print(" ");
}
int i=0;
System.out.print("\n");
System.out.println("l2 is:");
while(i<3){
System.out.print(l2.get(i));
System.out.print(" ");
i++;
}
System.out.print("\n");
System.out.println(l1.contains(27));
System.out.println(l1.indexOf(238));
l1.remove(4);
System.out.println(l1.contains(5));
}
}