Exercises

To extend your knowledge of the subjects covered today, try the following exercises:

  • Modify the WebMenu program so that it generates 10 URLs that begin with www., end with .com, and contain three random letters or numbers in between (such as http://www.mcp.com, http://www.cbs.com, and http://www.eod.com). Use these URLs in 10 WebButton objects on an applet.

  • Write a program that takes finger requests, looks for a plan file matching the username requested, and sends it if found. Send a "user not found " message otherwise.

Where applicable, exercise solutions are offered on the book's Web site at http://www.java21days.com.

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.