Ok I would like to create some variable names from other variables, but I don’t seem to be able to get this to work, I have tried a couple of ideas. Is it possible to do this?
What I would like is that, I could increment the name of a variable so I can create variables with different names.
Please help.
1.Code:int increment = 0; SubClient clientobject+increment = new SubClient(firstname,lastname,tphone,address);2.Code:Error 1 reportprogram.java:245: ';' expected SubClient variablename + increment = new SubClient(firstname,lastname,tphone,ad ress); ^ 1 errorCode:int increment = 0; String newvariablename = "clientobject"+increment ; SubClient newvariablename = new SubClient(firstname,lastname,tphone,address);Code:Error 2 reportprogram.java:245: variablename is already defined in methreadDataIntoDest nation(java.lang.String) SubClient variablename = new SubClient(firstname,lastname,tphone,address); ^ 1 error


Reply With Quote


Bookmarks