-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAList.java
More file actions
37 lines (24 loc) · 776 Bytes
/
AList.java
File metadata and controls
37 lines (24 loc) · 776 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
package com.tamang.lok.ArrayList;
//import java.util.*;
public class AList {
public static void main(String[] args) {
java.util.ArrayList<String> al = new java.util.ArrayList<String>();
al.add("apple");
al.add("bapple");
al.add("capple");
al.add("dapple");
al.add("eapple");
System.out.println("Original AL lists: " + al);
System.out.println();
java.util.ArrayList<String> al1 = new java.util.ArrayList<String>();
al1.add("apple1");
al1.add("bapple1");
al1.add("capple1");
al1.add("dapple1");
al1.add("eapple1");
System.out.println("Original AL1 lists: " + al);
System.out.println();
al.addAll(al1);
System.out.println("After adding collection al1 to al: " + al);
}
}