Connecting to the Internet: The URL Class

Back in Chapter 36, "Developing Java Applets," you learned how to write a tiny Java program—HelloWorld.java —with only one executable statement. People have been writing tiny programs that write information to the screen ever since there were computer screens. One of the features that makes Java exciting is that you can connect to the Internet with a program that's not much more complex than HelloWorld.java.

Note

For years, Sun has been telling us that "the network is the computer," and its design of Java reflects that philosophy. Java is the only major language that enables you to connect your program to the Internet in just one line of code, as shown in line 38 of Listing 39.1 (the entire listing appears ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 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.