previous | start | next

Summary: Applications

Applications have a main method and can use public static methods of utility classes as well as instance methods of type I or type II classes.

Calling the static method random() in the utility Math class:

      double d = Math.random(); // Math is the class name
                                // random is a static method
   

Calling the reset() instance method of the StopWatch class:

      StopWatch c = new StopWatch(); // Must create an instance!

      c.reset();  // c is an instance of the StopWatch class
                  // reset is an instance method
   


previous | start | next