Java Programming
CIS279
Tori Basford
tori@bly.net
Assignment(s):
None
Exercise(s):
Quiz 2:
Accounts:
User accounts should be set up now. The name is your first initial and your last name, and the password is '123456'. Upon logging in, you will have to set a new password. You also need to copy the shortcuts to JDK to the desktop. The correct ones are located in "d:\jdk1.31\ShortcutsD\PimaEast".
The Dog Class: An Example:
class Dog {
    static int a;
    int b;
    public static void main() {
        int c;
        System.out.println(fx());
        ...
    }
    static int fx() {
        ...
    }
    double fy() {
        ...
    }
}
In this example, static int a, method main(), and method fy() are located in the class. int b and method fy() are in the Dog object, which is NOT created until someone calls new Dog();.
Static methods and variables can call other static variables and methods, but can NOT call non-static items.
Each Dog object can be called an instance of the class Dog. Calling new Dog() is called 'instantiating the class'.
The toString() function:
Every object has a function called toString() which is used by Java to convert the object to a string for printing. If a toString() function is not written by the programmer, Java makes one automatically.
More on the Abstract Windows Toolkit:
If you use anything from the Abstract Windows toolkit (awt), Java starts some independent threads. To stop all threads and return to the DOS prompt, press Control-C.
To load the AWT, you have to import the classes in the package by using the import java.awt.*; command.
After importing the AWT, you have access to the following classes: