Lesson 17. Communicating Over HTTP

Java was initially developed as a language to control a network of interactive consumer devices. Connecting machines was one of the main purposes of the language when it was designed—and that is still one of the purposes of Java today.

The java.net package makes it possible to communicate over a network, providing cross-platform abstractions to make connections, transfer files using common web protocols, and create sockets.

When the java.net package is used in conjunction with input and output streams, reading and writing files over the network becomes as easy as reading or writing files on disk.

The java.nio package expands Java’s input and output classes.

In this lesson you’ll write networking Java programs ...

Get Sams Teach Yourself Java in 21 Days (Covers Java 11/12), 8th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.