nerdexam
GIAC

GSSP-NET · Question #154

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You are developing an application that manages sports teams. When a…

The correct answer is D. Dictionary<int, string> team = new Dictionary<int, string>(); team.Add(1, "Bob Jones"). See the full explanation below for the reasoning.

Question

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You are developing an application that manages sports teams. When a user queries details about a particular team, the id and name of each member of the team must be stored as a single collection. You must create the collection of team members in the most efficient manner, in a manner that guarantees type safety, and in a manner that will require the least amount of code to retrieve and work with the data in the collection. Which code segment should you choose? GIAC GSSP-.NET Exam

Options

  • Astring[] team = new string[] {
  • BArrayList team = new ArrayList();
  • CHashtable team = new Hashtable();
  • DDictionary<int, string> team = new Dictionary<int, string>(); team.Add(1, "Bob Jones");

How the community answered

(32 responses)
  • A
    3% (1)
  • B
    13% (4)
  • C
    6% (2)
  • D
    78% (25)

Community Discussion

No community discussion yet for this question.

Full GSSP-NET Practice