I have a SportsCentre
class which contains an array of Employee
objects.
Which is the right way to show that an attribute's data type is an array of objects?
I have found two different versions online:
the first one uses the
ArrayList<>
keyword:SportsCentre - listOfRegistered : ArrayList<Employee>
getRegisteredList() : ArrayList<Employee>
the second one uses square brackets
[]
:SportsCentre - listOfRegistered : Employee[0..*]
getRegisteredList() : Employee[0..*]