-
Notifications
You must be signed in to change notification settings - Fork 0
/
LinkedListCharacters
41 lines (29 loc) · 1.14 KB
/
LinkedListCharacters
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
//<Random Integers> Producing random characters using LinkedList
//CSIS312 - <Assignment 5-2>
//Citations if necessary>--
package linkedlistcharacters;
import java.util.List;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Collections;
import java.security.SecureRandom;
import java.util.Arrays;
public class LinkedListCharacters {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Lisa Tidball - Assignment 5-2");
Character[] characters = {'a', 's', 'i', 'l', '/' , 'i', 'r', 'r', 'e', 't'};
LinkedList<Character> listCharacter = new LinkedList<Character>();
// List<String> list2 = new LinkedList<>();
for(int i = 0; i<10; i++){
Character x = characters[i];
listCharacter.add(x);
}
System.out.printf("Object array elements: %s%n", listCharacter);
Collections.reverse(listCharacter);
System.out.printf("Reverse object array elements: %s%n", listCharacter);
}
}