-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDemo.java
More file actions
42 lines (33 loc) · 905 Bytes
/
Demo.java
File metadata and controls
42 lines (33 loc) · 905 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
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
public class Demo {
public static void main(String[] args) {
//JAVA 17
ArrayList<Integer> list =
new ArrayList<Integer>();
list.add(1);
list.add(2);
list.add(3);
list.add(4);
list.add(5);
System.out.println
(list.get(0));
System.out.println
(list.get(list.size()-1));
LinkedHashSet set = new LinkedHashSet();
set.add(1);
set.add(2);
set.add(3);
System.out.println( set.iterator().next());
LinkedHashMap map = new LinkedHashMap();
map.put(1, 1);
map.put(2, 2);
map.put(3, 3);
map.get(1);
int x = 5;
x *= (3 + 7);
System.out.println(x);
//System.out.println(x);
}
}