Hello, I'm a newbie on C# and I have a question in two parts.
Say I have a class Team that defines name and location. I need to write a method that returns an array of Teams.
My first question is... by best pracitce, should I define this method within my Team class? or should it be out side since its returning an array of teams.... (or it doesn't matter)
My second question is, what's the best way to return an array of objects? ArrayList?

Thanks in advance!!

If not required to use Array or ArrayList, I wouldn't use either. Use a typed list instead: List<> .

I would put the method outside of your Team class, but it really depends on where you intend to store your Team list or array.

The best way to return an array or list of objects depends on how you intend to use the returned object.

Thank you DoubleD, I'll keep this in mind.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.