So I want to draw multiple things so I am writing a method that accepts strings.
I'm not really sure how to do this or if this is even legal. Also if there is a better way of doing this please let me know. I have to draw more than 10000 cubes so I don't really want to type it our that much times.
So here's what I am thinking,
I have a method that draws thing that takes in a string.
public void drawCube(String s)
{
Box s = new Box(10, 10, 10);
}
and then have some kind of for loop that calls this method every time, concatenating the i into some name for how much I need to call this.
I know that this is wrong since s is already used. How would I use the stored string of s for the name instead of s itself?
Is this possible or not?
And is there a better way of doing this?