Day 19. Communicating Across the Internet

One of the more remarkable things about Java is how Internet-aware the language is. As you might recall from Day 1, "21st Century Java," Java was developed initially as a language that would control a network of interactive consumer devices. Connecting machines together was one of the main purposes of the language when it was designed, and that remains true today.

The java.net package 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 with input and output streams, reading ...

Get Sams Teach Yourself Java 2 in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.