Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Eval in Java?

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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,
 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hey Matt,
I don't know the solution, but trying to understand your question.
Can you please elaborate?
thanks,
sri
 
Matt Ghiold
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Is this question in the correct thread?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
It was the best of times. It was the worst of times. It was a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
    Bookmark Topic Watch Topic
  • New Topic