Hey I was wondering if it would be possible to give some initialization to an interface when an implementer is made. Like a blank constructor in an abstract class.
I tried something like this:
public interface State {
{
//Do something.
}
public void render();
public void tick();
}
But it does not let you have an instance initializer. Is there any way to do this? Possibly with an inner class?
So the idea is that a piece of code is automatically called when a new instance of an implementing object is created.