-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray lists.java
More file actions
56 lines (47 loc) · 872 Bytes
/
Copy patharray lists.java
File metadata and controls
56 lines (47 loc) · 872 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
47
48
49
50
51
52
53
54
55
56
package week05;
import java.util.ArrayList;
import java.util.Random;
public class Temp3
{
public static void main(String[] args)
{
ArrayList a = new ArrayList();
// a[0] = 45678;
a.add(234567);
//C++
a.add("Python");
a.add(true);
a.add(4.5);
a.add(4.5f);
a.add('F');
a.add("Java");
a.add(new Random());
System.out.println(a);
System.out.println(a.size());
System.out.println(a.get(0)); //a[0]
a.add(1, "C++");
System.out.println(a);
a.set(1, "Matlab");
System.out.println(a);
}
}
package week05;
import java.util.ArrayList;
import java.util.Random;
public class Temp4
{
public static void main(String[] args)
{
ArrayList<Random> a = new ArrayList();
// a[0] = 45678;
a.add(234567);
//C++
a.add("Python");
a.add(true);
a.add(4.5);
a.add(4.5f);
a.add('F');
a.add("Java");
a.add(new Random());
}
}