Link to home
Start Free TrialLog in
Avatar of mb2297
mb2297

asked on

Java object reference from string

In some languages you can use a string as an object reference.

For example, in ActionScript:

var foo = "bar";
_global[foo] = "baz";

Is the same as saying

_global.bar = "baz";

Is this possible in Java, and if so what's the syntax?

Thanks,
Matt.
ASKER CERTIFIED SOLUTION
Avatar of bpmurray
bpmurray
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mb2297
mb2297

ASKER

Using a Map was my backup plan. Thanks bpmurray