String getName(Object o)
{
//TODO
}
String object = "i want to get "object" not these words"
getName(object);
Is it possible the method return "object"? thx
String getName(Object o)
{
//TODO
}
String object = "i want to get "object" not these words"
getName(object);
Is it possible the method return "object"? thx
There is no way to get the name of a local variable used to pass a value to a method.
You may be able to do some kind of static source code analysis, but at runtime the stack does not include information such as this.