I'm a beginner and I have a question about building objects.
I don't understand how it is possible to create two objects with the same variable name "oneCar" in this situation :
for (int i = 0; i<2 ; ++i)
{
Car oneCar = new Car();
}
It will create two objects "oneCar" with two different references.
But if I do this :
Car oneCar = new Car();
Car oneCar = new Car();
This will tell me that there is a duplicate variable.