1
Answer

arraylist .Clear Help me plz

adam yhap

adam yhap

17y
2.2k
1

hi i have to create a program that deals cards and shuffles them. when i pull a card i wanted to put it into a new array and remove it from the first one. im new so dont be surprised if i make obvious mistakes

this is an example of what im trying to do

using System;

using System.Collections;

using System.Text;

namespace ConsoleApplication1

{

class Program:ArrayList

{

static void Main(string[] args)

{

int i = 0;

Class1[] abc = new Class1[52];

abc[i] = new Class1("string");

//i have tried 2 things here to test it

abc[i].Clear();

// and ive tried abc[i].removeAt(i) since abc.removeAt does nothing

if (abc[i] == null)

Console.Out.WriteLine("null");

else

{

Console.Out.WriteLine("not null");

Console.Out.WriteLine(abc[i]);

}

Console.In.Read();

}

}

}

 

using System;

using System.Collections;

using System.Text;

namespace ConsoleApplication1

{

public class Class1:ArrayList

{

string STR;

public Class1(string str)

{

STR = str;

}

public override string ToString()

{

return STR;

}

}

}

 

can anyone plz tell me what im doing wrong?

Answers (1)