-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathArray.java
More file actions
26 lines (21 loc) · 639 Bytes
/
Array.java
File metadata and controls
26 lines (21 loc) · 639 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
import java.util.*;
public class Array
{
public static void main(String[] args)
{
System.out.print("\n" + "Add item to end of Array:" + "\n");
String[] x = {"alpha","bravo","charlie","delta","echo","foxtrot"};
Array.push(x);
System.out.print("\n");
}
public static void push(String[] items)
{
List<String> temp = new ArrayList<String>(Arrays.asList(items));
temp.add(items.length,"Xray");
items = temp.toArray(new String[temp.size()]);
for(String item : items)
{
System.out.print("item = " + item + "\n");
}
}
}