I wrote some code in wich it has a class named Cars as below:
public class Cars
{
public Cars()
{
string ma;
int pe;
Console.WriteLine("PLz put the car name:");
ma = Console.ReadLine();
Console.WriteLine("PLz put car no :");
pe = Convert.ToInt16( Console.ReadLine());
}
}
Now I want to create multiple objects of it like a list or an array.
I know this code and I don’t know how to use a for loop for this in case it can create multiple cars automatically
Cars[] car = new Cars[10];
or
List <Cars>
The thing is I don’t know how to use them, please help me if you can.
Something a bit like below, will help you. But like the guys have said, you need to start with basics, reading from books is always best.