I have a program for Android with few classes. In my MainActivity i am using those classes. For example i have this class named Car. and so in my main activity i put this code to make a new "car" object.
Car car = new Car();
Now i also have a variable called count. that always increment by one. I want My main activity to create class every time (count%10 == 0). with a name like that car10,car20,car30. The number changer as the counter changes too. I did something like that and got stuck:
for(int i=0;i<100; i++)
{
if(i%10 == 0)
{
Car car+i = new Car();
}
}
but it didn't work. Any Idea?