Reflection: get invocation object in static method?

No is impossible...the static method don't have the reference, you have to pass it reimplementing the method as.

No is impossible...the static method don't have the reference, you have to pass it reimplementing the method as: class A{ static void foo(A theObject){ } } A a = new A(); A. Foo(a); and is better don't call the static method from the instance of the object.

Firstly, your code isn't good as a programmer. It is because static methods are class-level methods and should be called without any instance of class. Recommended approach : class A{ static void foo(){ } } A.foo(); Can I get instance a in method foo()?

Nope, you can't. Because foo() is declared as static. So you can't use this inside that method, since this contains a reference to the object that invoked the method.

By definition, there is no instance object for a static method (static methods do not operate on a specific object, they are defined within a class purely for namespacing) -- so no.

No; that's what static means. The compiler actually completely ignores the instance. Use an instance method.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions