This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The author of Class1 expects type to be set based on the String parameter value. There could be other methods in Class1 that depend on type being set. The author of Class1 assumes it was initialized because he/she set it in the constructor. If it is not set, other methods could throw errors or act unpredictably.
Now the Subclass author decides they would like to extend Class1. They create their own setType() method that does something completely different. Now Class1 doesn't do what it is supposed to anymore causing Subclass to break. Worse the Subclass author wasn't planning to override setType() and isn't aware of it.
The two solutions are to make the method private or final. Private allows Subclass to have its own setType() method. Final gives a compiler error so the Subclass author can name the method something else.