nerdexam
GIAC

GSSP-NET · Question #385

You work as a Software Developer for ABC Inc. The company uses Visual Studio .NET 2005 as its application development platform. You are creating an application using .NET Framework 2.0. You are…

The correct answer is C. StringBuilder MyStrBuild = new StringBuilder("ABC"); D. StringBuilder MyStrBuild = new StringBuilder("ABC", 75). 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 creating an application using .NET Framework 2.0. You are using the StringBuilder class to string values. You want to create a StringBuilder object that can store 75 characters and should be initialized with "ABC". You also want to append a formatted string to the end of the StringBuilder object. Which of the following code segments will you use to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.

Options

  • AStringBuilder MyStrBuild = new StringBuilder(75);
  • BStringBuilder MyStrBuild = new StringBuilder("ABC", 75); MyStrBuild.Append("INDIAUS");
  • CStringBuilder MyStrBuild = new StringBuilder("ABC");
  • DStringBuilder MyStrBuild = new StringBuilder("ABC", 75);

How the community answered

(52 responses)
  • A
    15% (8)
  • B
    8% (4)
  • C
    77% (40)

Community Discussion

No community discussion yet for this question.

Full GSSP-NET Practice