How do I make a progression with a variable in Java? -


i interested in how call variable changes, such customer1, customer2, customer3, etc. these customer variables populated in particular class. program automatically type number when perform such customer1.returnname(); if user types 1. without me making case case code. user type number of customer , automatically uses number. function best this?

if have numbered variables, use list.

arraylist<customer> customers = new arraylist<customer>();  customers.add(new customer("name"));  customers.get(0).returnname(); 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -