How do you know whether to make a class, a subclass, an abstract class, or an interface?
Make a class that doesn’t extend anything (other than Object) when your new class doesn’t pass the IS-A test for any other type.
Make a subclass (in other words, extend a class) only when you need to make a more specific version of a class and need to override or add new behaviors.
Use an abstract class when you want to define a template for a gr...
- 8. Interfaces and Abstract Classes: Serious Polymorphism
- from Head First Java, 2nd Edition
- Publisher: O'Reilly Media, Inc.
- Released: February 2005
Quando fare classi astratte, sottoclassi, classi astratte e interfacce
Share this highlighthttp://www.safaribooksonline.com/a/head-first-java/47401/