Can I establish a variable with its name being that of another variable's value?

I want to take the value of a variable and establish a new variable named whatever is in the value of the first variable. Is this possible?

Tagged:

Answers

  • Answer ✓

    no - java is a compiled language and variable names are fixed at compile time.

    but you can add an entry to a hash with the name taken from the value of another variable, which might be enough, depends what you're trying to do.

  • Ok thank you so much

Sign In or Register to comment.