EDIT: I'm so sorry, I need to expand. I'm using LibGDx, so my code is actually more complex.
Rock1 = new TextureRegion(texture, 5, 10);
Rock2 = new TextureRegion(texture, 6, 11);
Rock3 = new TextureRegion(texture, 7, 12);
int rannum = ran.nextInt (3)+1;
I want it to be that the rock that shows up is random.
I have a random integer called 'rannum' that is set between the bounds of 1 and 3. So I want to figure out how I can get a method that makes it so that I can combine "Rock" and "rannum" so that it can randomly return either Rock1, Rock2, or Rock3.
I'm not referring to concatenating two strings - but specifically object names.
How can I do this? Does it require using an array?