So I am learning java, and would still consider myself a beginner, only to get "noob-friendly" responses, and I am not stuck but just wondering how something is possible.
Here is my code:
import java.net.*;
public class HomePage {
String owner;
URL address;
String category;
public HomePage(String inOwner, String inAddress)
throws MalformedURLException {
owner = inOwner;
address = new URL(inAddress);
}
public HomePage(String inOwner, String inAddress, String inCategory)
throws MalformedURLException {
this(inOwner, inAddress);
category = inCategory;
}
}
Now my question is this: How is it possible to make two objects (HomePage) with the same name, and handling almost identical things (with the exception of inCategory in the second HomePage)?
In this section I am learning how to handle errors, so this class is used by another class which I understand. But I am not sure why I am able, and why I do, create two objects that are almost identical. Thanks!
For reference, here is the other class in the compilation: (due to reputation and links in the code, I had to pastebin)