Like so : a class has a method called sayHello() . When a instance of the class call the sayHello(), a method in another class is called automatic before the sayHello() is
Check AspectJ, and aspect-oriented programming framework. It will allow you to do something similar.
You see, in order to make this happen, you class should be managed by some container which instantiates your objects and makes proxies of them.
AspectJ has an alternative by plugging some "magic" into the VM.
I think you are looking for an aspect-oriented programming framework such as AspectJ, JBoss AOP or Spring AOP.
The decoration of the Person method by the Robot method will happen during construction of the Person instance, but you will need to use a factory class provided by the AOP container instead of new.