M
Mouch
Hi,
I'm looking for a way to find a variable value in the calling class...
Ex :
Car myCar = new Car();
car.setName("Audi");
Wheel w = new Wheel ();
(...)
//In the Wheel class, i would like to know the name of the "calling"
Car.
//This is what I want...
String answer = wheel.getCarNameWhoCreateMyInstance(); //the result
would be audi
I know, a simple way would be to add a method in the Wheel class but I
can't...
If someone have an idea...
Thanks for any help.
M. Mina
I'm looking for a way to find a variable value in the calling class...
Ex :
Car myCar = new Car();
car.setName("Audi");
Wheel w = new Wheel ();
(...)
//In the Wheel class, i would like to know the name of the "calling"
Car.
//This is what I want...
String answer = wheel.getCarNameWhoCreateMyInstance(); //the result
would be audi
I know, a simple way would be to add a method in the Wheel class but I
can't...
If someone have an idea...
Thanks for any help.
M. Mina