View Single Post
  #3 (permalink)  
Old 08-08-2007, 03:16 AM
lockmac lockmac is offline
Member
 
Join Date: Aug 2007
Posts: 8
lockmac is on a distinguished road
Quote:
Originally Posted by goldhouse View Post
First correction in the code I like to make is we usually wont create objects of type ArrayList but only List
Second I dont think 1005 is a valid name ....
Ooooooooh enough of finding the mistakes Sorry dude

About your question what I understood you need is the little bit complicated In fact I dont know the way to do that .. ie
"the variable name will be dynamic "

Actually do you really need something like that , From my three years of programming I was happy with the 'static' variables

Cant you tell me a situation you will need this
Thanks for the reply mate. Well if I keep the name of the instance static (e.g. Unit101) and have that hardcoded into the program, wont everytime a new unit is created it will just point to the previous unit that was created (as they would have the same instance named of Unit101)? I don't really care at all what the name of instance is because it then goes into the ArrayList once created anyway from where I can just access it by index........

OO yeh the name 1005 is just for illustration purpose... and also what do you mean about calling the object List? I thought that was the correct way to use the ArrayList...

cheers

Last edited by lockmac : 08-08-2007 at 03:26 AM.
Reply With Quote