Why is array added here? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why is array added here?

Anybody know why did bucky added array in the if statement when i don't think its needed and why is he putting an object in the constructor? Link to the video: https://youtu.be/slY5Ag7IjM0

14th Dec 2019, 10:31 AM
Chcrf
Chcrf - avatar
1 Resposta
0
I watched the video. I am not sure if you added the correct link. Because he is not using any constructor. It is just an example how to store objects in an array. Class DogList has an array which stores objects of class Dog. The if statement inside void add(Dog d) checks if the array is full.
14th Dec 2019, 6:09 PM
Denise RoƟberg
Denise RoƟberg - avatar