+ 7
Can anyone help?
I want to create such a program that automatically names the variables in such a way that if the user wants 6 variables it would automatically create them and name them in such a way that the first variable is d1 and then the variable names go on till d6
7 Antworten
+ 4
err how did I forget about arrays
+ 4
But I want to do such a thing for Scanner in java
+ 4
one more thing can I name the variable as per user input
+ 4
Well if there could be programs that modify their code themselves I think that there could be programs that could modify themselves as per user input
+ 2
you can do it without changing the source code just have a for loop that has a iteration variable that is entered by the user and run it through an array to store each value.
+ 1
do it in array...automatically first element is array [0] and it will goes till array [n-1]