Incremental Java
API (Application Programmer's Interface)

API

When someone writes a class and wants others to use it, they publish an API, which stands for "Application Programmer's Interface". This is a list of public methods that the class supports, and a description of what each method does.

The description can be informal, written in English, or it can more formal and written in a logic language. Even though formal specifications are often more accurate, they are harder to read. A typical programmer would have to learn the logic language before they could read an API.

For this reason, the Java APIs are written mostly in English, with some technical words used.

Occasionally, a company may advertise an API even though the class hasn't been written yet. This allows programmers to write programs using a non-existent class. If they can mimic the behavior of the class or if it's easy to understand what the API should do (even if it's hard to write the class), then code can be written ahead of time.

Where to Find the API?

You can always buy a book with the Java API, but usually programmers head over to Sun's website and look up the API in a browser.

Here's the link to Java 1.4.2 SDK (Standard Development Kit) API. It's http://java.sun.com/j2se/1.4.2/docs/api/index.html. J2SE is short for Java 2, Standard Edition.

At this webpage, you find three subdivisions. The small window in the upper left hand corner is the list of packages. Let's ignore that for now. The larger window beneath it is the list of all of the Java classes/interfaces that come with the standard distribution. There's a lot of these classes/interfaces. They are in alphabetical order, which should make it easy to find.

On the right, occupying the most space is the API. Click on any of the classes, and you see a lengthy description of the class. In particular, there is a list of methods, and a description of what each method does.

You should be using this webpage quite a lot when looking up information you need on a class. It's a very useful resource.