Q&A

Q1:

Why isn't javax.swing.JApplet needed in the class statement of the Revolve applet?

A1:

It isn't needed because of the import statement that makes all the javax.awt.swing classes available to the program. The only purpose of import is to make it easier to refer to classes in a program. If you don't use it, you have to use full class references such as javax.swing.JApplet instead of simply JApplet. You could write all of your Java programs without using import, though it would make the source files more difficult to understand.

Q2:

If the Revolve applet only has one thread, what's the point of using threads at all?

A2:

Multithreading has benefits even it's really just one-threading. One of the main benefits is that you can start, stop, and pause a thread from within a program; you don't have the same kind of control without threads. Also, by making an applet a thread, even for a single-thread project, you make it easier to implement additional threads as needed later on.

Q3:

Are there any reasons not to leave a pair of empty brackets after a catch statement, which causes errors to be disregarded?

A3:

It depends on the type of error or exception being caught. In the Revolve applet, you know with both catch statements what the cause of an exception would be. Because of this knowledge, you can handle the error. In the getURL() method, the MalformedURLException would only be caused if the URL sent to the method is invalid.

Q4:

At what point did someone start the modern calendar by declaring, "Well, let's see, Jesus lived 125 years ago, so this is 126 A.D.?"

A4:

That happened in around 532 A.D. when the Scythian monk Dionysius Exiguus overhauled the calendar to stop paying homage to a Roman emperor who persecuted Christians. In a table indicating when Easter should be celebrated, Exiguus counted years from the birth of Jesus rather than the reign of Emperor Diocletian. His new system had no year 0, skipping from 1 B.C. (Before Christ) to 1 A.D. (Anno Domini). The concept of zero as a number wouldn't be adopted in Europe for another three centuries. Some scholars believe that Jesus was born between 7 B.C. and 4 B.C., which throws a wrench into Exiguus' numbering.

      
Comments