This is a past exam question focusing on arrays and here is the question:
Define a class called Laboratory that contains an array of Computers.
The size of the array should be specified in the constructor to the
Laboratory class. Your class should contain methods for adding a
Computer to the array.
(early part I had to define a computer class with a couple of attributes with a constructor)
So I know how to do the first two parts, the class and size specified in the constructor.
How would I do the third part (about the methods)?
Assuming you’ve already written the constructor that creates the array: