You create Microsoft Windows-based applications. You are creating a method. Your applications will call the method multiple times. You write the following lines of code for the method.
public string BuildSQL(string strFields, string strTable, string strFilterId) {
string sqlInstruction = “SELECT “;
sqlInstruction += strFields;
sqlInstruction += ” FROM “;
sqlInstruction += strTable;
sqlInstruction += ” WHERE id =”;
sqlInstruction += strFilterid;
return sqlInstruction;
}
The method generates performance issues. You need to minimize the performance issues that the multiple string concatenations generate.
What should you do?
A.
Use a single complex string concatenation.
B.
Use an array of strings.
C.
Use an ArrayList object.
D.
Use a StringBuilder object.