Random random = new Random();
int[] array = new int[random.nextInt(16)];
int x = 1;
int y = 0;
int z;
for (int i = 0; i < array.length; i++) {
z = x + y;
x = y;
y = z;
array[i] = y;
}
System.out.println("Исходный массив: " + Arrays.toString(array));
public class Main
{
public static void main(String[] args) {
Integer[] intArray = {10,20,30,40,50,60,70,80,90};
//print array starting from first element
System.out.println("Original Array:");
for(int i=0;i<intArray.length;i++)
System.out.print(intArray[i] + " ");
System.out.println();
//print array starting from last element
System.out.println("Original Array printed in reverse order:");
for(int i=intArray.length-1;i>=0;i--)
System.out.print(intArray[i] + " ");
}
}