One of the more remarkable things about Java since its introduction is how Internet-aware the language is. As you might recall from Day 1, “A Fistful of Java,” Java was developed initially as a language that would control a network of interactive devices called the Star7. Duke—the animated mascot of Sun who looks a bit like a dancing bicuspid—was the star of these devices.
Java's class library includes the
java.net package, which makes it possible to communicate over a network with your Java programs. The package provides cross-platform abstractions for simple networking operations, including connecting and retrieving files by using common Web protocols and creating basic UNIX-like sockets.
Used in conjunction ...