Strings in variable names?
So say I have a string called name which maybe be equal to "Sam" or "Max" or maybe "Betty". I'm trying to make a variable that has a different name for each value of name.
For example it might be Samitems or Maxitems or Bettyitems.
Is there anyway way to insert a string into a variable name?
Re: Strings in variable names?
Quote:
anyway way to insert a string into a variable name?
You create variable names when you type them into the source code.
If you want to use a String to access a value when the a program is executing, look at the Map class.