Dynamically reassign method bodies to objects
问题 Is it possible to have class A with an empty method say render() .. then you create 3 instances of the class, so you have objects b, c, d , so can I THEN assign bodies for the render method for each object? Here's an example, in JavaScript you can have an object say a and then anywhere you can say a.method = function() { /* do something */ } After that line, you will have a method with the name method for the object a and whenever called it will /* do something */ . Is this possible in Java