October 2011
Beginner
432 pages
10h 18m
English
For the next project, you create a class that uses exceptions to tell another class about an error that has taken place.
The classes in this project are HomePage, a class that represents a personal home page on the Web, and PageCatalog, an application that catalogs these pages.
Enter the text of Listing 18.4 in a new empty Java file called HomePage.
Listing 18.4. The Full Text of HomePage.java
1: import java.net.*; 2: 3: public class HomePage { 4: String owner; 5: URL address; 6: String category = "none"; 7: 8: public HomePage(String inOwner, String inAddress) 9: throws MalformedURLException {10:11: owner = inOwner;12: address = new URL(inAddress);13: }14:15:
Read now
Unlock full access