jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spam...@uark.edu
Subject accessing local variables
Date Sun, 11 Jul 2004 00:45:49 GMT
Hi ,

Is there a way to access local variables declared in a function in another function during
run time.



Say for example I have the following program



public class abc{



public static void f()

{

 int x=10;

 .....



}



public static int g()

{

 int y=4;

  return x+y;

}



public static void main(String args[])

{

  System.out.println("The result of g() is " + g());

}



}



Is there any possibilities of g() accessing variable x declared in f().



Im simplifying the issue. Actually I want to do this at runtime.



Help would be greatly useful



-Sri



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Mime
View raw message