forked from JsonChao/Awesome-Algorithm-Study
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
46 lines (29 loc) · 942 Bytes
/
Copy pathMain.java
File metadata and controls
46 lines (29 loc) · 942 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
36
37
38
39
40
41
42
43
44
45
46
package array;
public class Main {
public static void main(String[] args) {
Array<Integer> array = new Array<>(10);
for (int i = 0; i < 10; i++) {
array.addLast(i);
}
System.out.println(array);
array.addLast(66);
System.out.println(array);
array.add(1, -100);
System.out.println(array);
boolean contains = array.contains(30);
System.out.println(contains);
boolean contains1 = array.contains(66);
System.out.println(contains1);
array.delete(3);
System.out.println(array);
array.deleteLast();
System.out.println(array);
array.deleteFirst();
System.out.println(array);
boolean b = array.deleteElement(10);
System.out.println(b);
boolean b1 = array.deleteElement(-100);
System.out.println(array);
System.out.println(b1);
}
}