MikeF98765
Gawd
- Joined
- Sep 26, 2003
- Messages
- 629
Ok so... i have a class with a static method doThing(). I want to subclass this class, and when the subclass calls the method doThing, i want it to know what class called it (the subclass).
So i have
when i call SubClass.doThing(); i want it to print out blah.blah.SubClass
how can i do this? Since it's a static method, you can't get the instance taht's calling it... is there any way to do this?
To clarify: How can i tell the difference between BaseClass.doThing() and SubClass.doThing()
So i have
Code:
public class BaseClass{
public static doThing(){
//Print name of class
}
}
public class SubClass extends BaseClass{}
how can i do this? Since it's a static method, you can't get the instance taht's calling it... is there any way to do this?
To clarify: How can i tell the difference between BaseClass.doThing() and SubClass.doThing()