0

After much research, I can't find anything on this, Is it even possible to generate an Array list entirely from user input, populating the list is easy, but I want to name the Array from user input also,

List<String> jTextfield.getText = new ArrayList<>();

Now i know this won't work, but is something to this effect even possible?

Sc001010tt
  • 33
  • 7
  • Just curious why do you want Arraylist Name to be from the user input ? – Saurabh Sharma Sep 29 '17 at 11:32
  • This is not possible in Java, and, moreover, should *not* be used even in languages where it is possible. It involves evaluating user input as code. Now, if you're thinking about *attaching a name* to a list that a user provides, that's easy: use `Map>`. Store the name of the user-provided list as the key, and the list itself as the value. – asthasr Sep 29 '17 at 11:32

0 Answers0