• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 39. Network Programming > Connecting to the Internet: The URL Class

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 in the next section):

URL theURL = new URL(theURLString);



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint