Q:

How to make a dynamic array Fibonacci series java program?

I am in 8th grade. I am taking a 12th grade java course. I just started and my home work is to make a Fibonacci series dynamic array program. I don't know where to go. It is online so I can't ask a teacher or something.
How do you make a Fibonacci sequence using a dynamic array in Java?
This was an example of a dynamic array I got:

I don't see how you can make the Fibonacci series out of it! Here is the Fibonacci series example I got. 

A:

You can combine the two examples, as such:
Take the DynamicArrayOfInt class, and add the main method of the Fibonacci class.
Insert a new statement at the beginning of the main method instantiating a DynamicArrayOfInt object, as such:
DynamicArrayOfInt arr = new DynamicArrayOfInt();

Replace every instance of numbers[x] with arr.get(x), and instances of numbers[x] = y with arr.put(x, y).
Remove the leftover statements dealing with the numbers array. This will essentially make use of the DynamicArrayOfInt object. A sample output would look like this:
iplante$ java DynamicArrayOfInt
Size of dynamic array increased to: 2
Fibonacci series:

0
1
Size of dynamic array increased to: 4
1
2
Size of dynamic array increased to: 8
3
5
8
13
Size of dynamic array increased to: 16
21
34
55
89
144
233
377
610
Size of dynamic array increased to: 32
987
1597
2584
4181
iplante$

