Assigning methods at runtime?
Hi All,
Hi all. I am a begining java programmer. This is an extension on a previous message I posted under a different header. See the subject
"User supplied methods in classes" for specifically what I am trying to accomplish.
Basically I want to if there is a way to implement a specific method at runtime. In other words, I want to have essentailly an abstract method, but implement the abstract method at runtime without having to derive a new class from it. Is this possible and what is the best way to accomplish this.
-Brad
Re: Assigning methods at runtime?
You cannot implement a method at runtime. Interfaces have been used quite liberally
for the kind of stuff you want. You might want to check out the chapter on interfaces
in "Thinking in Java" at
http://www.codeguru.com/java/tij/