T
Tom Jones
I have a class that contains a collection of reference types. This class
needs to have a method that returns the collection to the caller.
The method's signature could be either (it could also be implemented as a
property):
MyObject[] GetObjects();
or
ArrayList GetObjects();
The caller can modify the objects that are returned (meaning the caller
should not get a copy of the objects).
The size of the collection is never going to change.
Is there any reason why I would want to return the objects in an ArrayList
verses a plain array?
Thanks,
TJ
needs to have a method that returns the collection to the caller.
The method's signature could be either (it could also be implemented as a
property):
MyObject[] GetObjects();
or
ArrayList GetObjects();
The caller can modify the objects that are returned (meaning the caller
should not get a copy of the objects).
The size of the collection is never going to change.
Is there any reason why I would want to return the objects in an ArrayList
verses a plain array?
Thanks,
TJ