Code
In the methodCode
public static void Copy(List source, List destination)Code
I want to understand the meaning after copy.In the methodpublic static void Copy(List source, List destination)I want to understand the meaning after copy.Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Scott LysleRank #49 · 31K reputationPosted Jan 5, 2009, 10:08 AM EST
It is there to cue the compiler to confirm the type; you need not add the type to the call when you use your copy command but it works with or without it so long as the source and target lists are of the same type:
private
void Form1_Load(object sender, EventArgs e){
List<string> sourceList = new List<string>(); List<string> targetList = new List<string>();sourceList.Add(
"A");sourceList.Add(
"B");sourceList.Add(
"C");Copy(sourceList, targetList);
for(int i=0; i}
public static void Copy{
{
target.Add(obj);
}
}