Recent articles:
Popular archives:
Java: A platform for platforms
Sun's reorg may seem promising to shareholders but it's also a scramble for position. The question now is whether Sun can,
or wants to, maintain its hold on Java technology. Especially with enterprise leaders like SpringSource and RedHat investing
heavily in Java's future as a platform for platforms
Also see:
Discuss: Tim Bray on 'What Sun Should Do'
Gosling and Yellin's definition of the Java API is nothing if not thorough. The first volume covers the core packages: java.lang,
java.io, java.util and java.net. The second volume defines the windows toolkit and applet packages: java.awt, java.awt.image,
java.awt.peer and java.applet. Each class and interface in these packages is clearly and minutely defined with text descriptions
of each public class, field, constructor, and method. What makes this reference so good is that it's not just a nicely formatted
printout of class declarations. Each class, method, field, and interface is described in a text note that tells you exactly
what you need to know quickly, so you can get on with your coding. The text descriptions truly provide useful information.
For example, in the definition of a constructor for the public class ThreadGroup, Gosling and Yellin tell us:
public ThreadGroup(ThreadGroup parent, String name)
Creates a new thread group. the parent of this new group is the specified thread group.
The checkAccess method of the parent group is called with no arguments; this may result in a security exception.
Parameters: parent: the parent thread group
name: the name of the new thread group
Throws: NullPointerException
if the thread group argument is null.
Throws: SecurityException
if the current thread cannot create a thread in the specified thread group.
This kind of information can be invaluable to the coder sitting there -- one hand on the keyboard and the other holding the reference. Taking this one step further, the authors describe one of ThreadGroup's enumerate methods:
enumerate public int enumerate(Thread list[])
Copies into the specified array every active thread in this thread group and its subgroups.
An application should use the activeCount method to get an estimate of how big the array should be. If the array is too short to hold all the threads, the extra threads are silently ignored.
That short note will save Java programmers a lot of time. As Gosling said in his keynote at JavaOne, he's made just about every mistake there is to be made, coding-wise. And he doesn't think he has the time to make those mistakes again. Fortunately for us, he doesn't think we have the time either.
In addition to the superb comments and warnings about common errors, the book is arranged to be very usable. In the back,
there is a 65-page index that has just the right level of granularity. This is the make-or-break feature of many reference
books, as no one actually goes through a reference from page one forward. You pick it up because you're looking for something,
and this index will get you where you need to go with minimal sidetracks.