Over this past year I have acquired a lot of skills needed to be a Java developer. So I decided to implement my own ArrayList! 😝
At first, I created a ddArrayList class with two private fields: an integer called count and an integer array called numbers. I first created a constructor that initializes the number of elements in numbers using a constructor.
When I implemented my methods in that class, I realized that I couldn’t use my ArrayList for any other array other than the original numbers array of zeroes! (e.g. {0,0,0}) I couldn’t even initialize the elements in the original array!
I figured out the problem by setting the parameter of my constructor to an int array, which then can be assigned to the numbers private field. Then, I don’t need to change anything else in the program! I can alter the initialized array however I want.
Thank God that I solved this problem 😅
Now I have to code the sort algorithms…
