Web Assignment 6


Another look at the API documentation.

The API (Application Program Interface) is a useful tool Java Programmer.
Go to http://java.sun.com/j2se/1.3/docs/api/index.html

All the classes in the standard Java libraries are documented here.

The upper right-hand frame contains a list of all the library names..

The lower left frame contains a list of classes.

Scroll down to System and click. Information about the class appears in the right-hand frame. More of this should make sense now.

Things to note:

1. java.lang - means the System class is in the java.lang library

2. The inheritance diagram shows that System is a direct subclass of object.

3. In the next section you find the class declaration

public final class System
extends Object

public means that every class has access to this class.
final means that it can not be extended.
extends Object tells you again that this is a subclass of object.

4. Scroll down to Field Summary.

You will see the out object. It also tells you that it is a PrintStream object. Also notice the in object. It is an InputStream object Both are static. This means only one of each exits and the objects can be accessed using the class name System

5. Look at Method Summary

See the arraycopy method? This is where you would look if you wanted to copy an array but couldn't remember the parameters.

What method would you use to terminate the curent program by terminating the current Java Virtual Machine? How would you call it?  
  see answer.

Look at the documentation for the String class.