You cannot do this in Java and, more importantly, you do not want to do this, since that is not how Java works. In fact, variable names are not as important as you think, and they hardly even exist in compiled code. What is much more important is that you can get a link to your objects as simple and reliable as possible. This may include an array, an ArrayList (probably what you want here), a LinkedList, a map such as a HashMap, Set, and other types of collections.
For instance:
List<Taco> tacoList = new ArrayList<Taco>(); for (int i = 0; i < MAX_TACOS; i++) { tacoList.add(new Taco(i)); }
source share