how can i create object with name of variables value | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

how can i create object with name of variables value

2nd Sep 2016, 3:22 PM
Eduard Fekete
Eduard Fekete - avatar
8 Answers
+ 3
No, you really don't need that. You could override an object's functionality to do something different or create properties in a class extending from a base class, which is really the proper way to do kind of what you're asking. If you don't understand how to do this, keep practicing, because what you're thinking of doing is not correct and for you to think it is correct proves you need more practice.
4th Sep 2016, 12:27 PM
Mike
Mike - avatar
+ 1
You don't. and if you could, why would you?
3rd Sep 2016, 3:03 AM
Mike
Mike - avatar
0
Please explain your question further..
2nd Sep 2016, 11:34 PM
Erwin Mesias
Erwin Mesias - avatar
0
how can i create object of class person with name of input ???
4th Sep 2016, 11:58 AM
Eduard Fekete
Eduard Fekete - avatar
0
you mean, if you enter "Edo" you want the variable name to be "Edo" also?
4th Sep 2016, 12:00 PM
Erwin Mesias
Erwin Mesias - avatar
0
yes
4th Sep 2016, 12:04 PM
Eduard Fekete
Eduard Fekete - avatar
0
Ahh.. NO, you can't do that. Plus, you don't need that :)
4th Sep 2016, 12:05 PM
Erwin Mesias
Erwin Mesias - avatar
- 1
i need
4th Sep 2016, 12:08 PM
Eduard Fekete
Eduard Fekete - avatar