What should the accessablity of Fields in a Abstract Class be?

Posted by James McMahon on Stack Overflow See other posts from Stack Overflow or by James McMahon
Published on 2009-08-18T20:14:19Z Indexed on 2010/03/25 11:33 UTC
Read the original article Hit count: 361

To put it simply as an example,

public abstract class AbstractFellow {

    protected Thing buddy;
....

public class ConcreteFellow extends AbstractFellow {
     public void someMethod() {
          buddy.doSomething();
          //OR
          buddy = somethingElse;
          //OR
          somethingElse = buddy;
     }
}

Is this bad practice?

© Stack Overflow or respective owner

Related posts about oop

Related posts about language-agnostic