Effective Java - Item 20 Prefer class hierarchies to tagged classes

Chapeter 4 Classes and Interfaces Item 20: Prefer class hierarchies to tagged classes tagged classes are verbose, error-prone, and inefficient. Occasionally you may run across a class whose instances come in two or more flavors and contain a tag field...

The Linux Programming Interface - Chapter 3 System Programming Concepts

Chapter 3 System Programming Concepts 3.1 System Calls [Concept] A system call is a controlled entry point into the kernel, allowing a process to request that the kernel perform some action on the process’s behalf. [How] How a system call...

Effective Java - Item 19 Use interfaces only to define types

Chapeter 4 Classes and Interfaces Item 19: Use interfaces only to define types When a class implements an interface, the interface serves as a type that can be used to refer to instances of the class. 1.constant interface: fails this...

Effective Java - Item 18 Prefer interfaces to abstract classes

Chapeter 4 Classes and Interfaces Item 18: Prefer interfaces to abstract classes 1.Existing classes can be easily retrofitted to implement a new interface. 2.Interfaces are ideal for defining mixins. 3.Interfaces allow the construction of nonhierarchical type frameworks. 4.Interfaces enable safe,...

Effective Java - Item 17 Design and document for inheritance or else prohibit it

Chapeter 4 Classes and Interfaces Item 17: Design and document for inheritance or else prohibit it 1.the class must document its self-use of overridable methods. 2.a class may have to provide hooks into its internal workings in the form of...