Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
If you follow the Java 101 column, you know that we are currently touring Java's object-oriented language basics. So far, this series has covered class declaration, object creation, field/method (including constructor method) declaration and access, object composition, object layering, multiple implementation inheritance, and the root of all classes. In addition, I have introduced the specialized topics of enumerated types and singletons. Read the whole series on object-oriented language basics, and learn what it means for a Java program to be object-oriented:
Part 6 of this series presents a deeper understanding of interfaces.
The word interface conjures up the image of a place where two independent systems meet for communication. For example, a human being and a computer communicate through a keyboard, a mouse, and/or some other input device. The input device serves as an interface between the computer and the human being. From a software perspective, an interface represents a service contract between a library that implements those services and code that calls upon that library's services. For example, a Java program obtains file I/O (input/output) services by creating objects from various file-related classes in Java's class library and calling their methods. Those classes and methods form an interface between code wanting file I/O and the actual file I/O code.
We can take the interface concept one step further: from Java's perspective, an interface is the introduction (but not an implementation) of a type at the source code level. To understand that concept, you first must grasp the notion of type, an abstraction that identifies a set of data items -- that share some commonality -- and a set of operations that manipulate those data items. For example, the integer type identifies a set of numbers that do not have fractional parts and a set of operations that manipulate those numbers (such as addition and subtraction). To support types, a computer language provides a facility that allows a developer to introduce (and possibly implement) a type in source code.
Developers introduce primitive types into source code through keywords (such as int or boolean) and operators (such as + or !). Primitive types have no implementation at the source code level: the compiler and the JVM provide an implementation. Developers
introduce reference types into source code through class and interface declarations. Classes implement reference types (at
the source code level) by declaring read/write field variables (to identify a set of data items) and method signatures with
code bodies (to identify a set of operations). Unlike classes, interfaces do not implement reference types in source code.