how can I declare java interface field that implement class should refine that field -
how can declare java interface field implement class should refine field ?
for example
public interface iworkflow{ public static final string example;// interface field public void reject(); } // , implement class public class abstworkflow implements iworkflow { public static final string example = "abcd"; /*must have*/ public void reject(){} ... }
thank you.
see section 9.3 of the specification. there no overriding of fields in interfaces - hidden in contexts, , ambiguous in others. i'd stay away. instead put getter in interface (getexample())
Comments
Post a Comment