My question is how do I change the following code to create 10 different instances of objects instead of 10 of the same Object.
List <OBJ> newList = new List<OBJ> ();
for (int i = 0; i < 10; i++){
OBJ newOBJ = new OBJ (i);
newList.Add(newOBJ);
}
Where the OBJ class is:
class OBJ {
public static int numb;
public OBJ(int i)
{
numb = i;
}
}
That are 10 different objects. But since the number is
static, they all have the same number.So make it non-static if you want.
If you want to count the number of instances, you can leave it as static.