Best practice for class field having different values in subclasses

Posted by Jakub on Stack Overflow See other posts from Stack Overflow or by Jakub
Published on 2010-06-08T09:47:56Z Indexed on 2010/06/08 10:02 UTC
Read the original article Hit count: 233

Filed under:
|

Hi,

I have some abstract class, in one of its method I use a string field which is supposed to be specific to the subclasses. I wonder what is the bect practice to implemnet this? via field and setting the field value in a consructors of the subclasses? via a static field and changing the value in every subclass?

What would you suggest?

© Stack Overflow or respective owner

Related posts about java

Related posts about best-practices