Forums Register Login

Eval in Java?

+Pie Number of slices to send: Send
Hey guys,
Does anyone know a way to do the following in java?
int count_5 = 12;
String test = 5;
count_$test would = 12 in korn shell.
Is there a way to do this in Java?
Please help.
Thanks,
+Pie Number of slices to send: Send
Hey Matt,
I don't know the solution, but trying to understand your question.
Can you please elaborate?
thanks,
sri
+Pie Number of slices to send: Send
Not a problem. Basically what I want to do is to be able to dynimically identify the variable count_5. I want to accomplish this by using a fixed count_ and apply a variable to that test in this case to identify the int count_5
So, something like this...
int count_5 = 12;
String test = 5
Now, I want to get 12, but the only way I know that is by using the variable test, such that
String count = "count_"
int x = count_ + test This should equal the count_5 varible and return a 12.
How this makes a little more sense.
+Pie Number of slices to send: Send
Is this question in the correct thread?
+Pie Number of slices to send: Send
Matt, I am not sure which forum this actually belongs in. However, it isn't for the SCJD assignment, so I have to close this thread. Please chose another forum to post this question that will better match your question.
Thanks
Mark
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


Reply locked
This thread has been viewed 563 times.
Similar Threads
What is the right way to unit-test a Java template class?
constuctor concept
SCJP 6 - Chapter 10 : Development
Nailed SCJP with 84% today and tips etc..
The complete material for SCMAD
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:55:52.