-
Notifications
You must be signed in to change notification settings - Fork 0
/
Array
36 lines (25 loc) · 939 Bytes
/
Array
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
//<Recursive> display elements in an array of integers
//CSIS312 - <Assignment 6-2>
//Citations if necessary>--
package array;
import java.security.SecureRandom;
public class Array {
public void printArray(int[] array, int step){
if(step < array.length){
System.out.print(array[step] + " ");
step++;
printArray(array,step);
}
}
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Lisa Tidball - Assignment 6-2");
SecureRandom randomNumbers = new SecureRandom();
int[] array = new int[100];
// array = 1 + randomNumbers.nextInt(100);
for(int i = 0; i < array.length ; i++)
array[i] = 1 + randomNumbers.nextInt(100);
Array r = new Array();
r.printArray(array, 0);
}//end main
}//end class Array