R
Riyaz
public class D {
public void myOwner(){
//i need to find the class who's calling me
}
public static void main(String[] args) {
new A();
new B();
new C();
}
}
class A {
public A() {
D d = new D();
d.myOwner();
}
}
class B {
public B() {
D d = new D();
d.myOwner();
}
}
class C {
public C() {
D d = new D();
d.myOwner();
}
}
In the above, in class D's myOnwer() i need an implementation which
tells who's calling the myOwner() i.e from class A or B or C
I also need the implementation to be compatible with Java 1.3
Any suggestions ?
public void myOwner(){
//i need to find the class who's calling me
}
public static void main(String[] args) {
new A();
new B();
new C();
}
}
class A {
public A() {
D d = new D();
d.myOwner();
}
}
class B {
public B() {
D d = new D();
d.myOwner();
}
}
class C {
public C() {
D d = new D();
d.myOwner();
}
}
In the above, in class D's myOnwer() i need an implementation which
tells who's calling the myOwner() i.e from class A or B or C
I also need the implementation to be compatible with Java 1.3
Any suggestions ?