B
ballpointpenthief
Is there a nice workaround for this?
I wanted to have a some static methods in an interface, but as you
probably know that's not legal.
This is what I'm trying to do:
Each object that implements this interface needs to handle certain
tasks (File parsing/writing, small JFrames etc...) in a way that is
specific to that particular class.
When the objects are being passed around, they are being passed around
with the interface type, but I need to be able to invoke their specific
methods.
Static methods declared in the interface would be ideal, but for some
reason this isn't allowed (why not?)
I'm guessing any workarounds may involve static variables, reflection
or C++.
Thanks,
Matt
I wanted to have a some static methods in an interface, but as you
probably know that's not legal.
This is what I'm trying to do:
Each object that implements this interface needs to handle certain
tasks (File parsing/writing, small JFrames etc...) in a way that is
specific to that particular class.
When the objects are being passed around, they are being passed around
with the interface type, but I need to be able to invoke their specific
methods.
Static methods declared in the interface would be ideal, but for some
reason this isn't allowed (why not?)
I'm guessing any workarounds may involve static variables, reflection
or C++.
Thanks,
Matt