"Anon" <> wrote in message news:<hpNsc.153$7A.96@newsfe1-win>...
> This may sound stupid, but for debugging purposes I need to find out the
> name of a variable.
>
> e.g. if I have a variable called myVariable, how can I use Java to return
> "myVariable" as a string?
It *does* sound stupid
If you know the variable name then you can just 'hard-code' the
string, why do you need to 'get' it at runtime?
If you don't know it (perhaps because it's in a separate package/class
you don't have source code for), then you can use reflection to query
a class for it's member names.
- sarge