Basic HTML version of Foils prepared July 6 99

Foil 33 Classes are used as program modules

From Use of Java Language in Computational Science DoD Modernization Users Group Conference Monterey -- June 7 99. by Nancy McCracken, Geoffrey C. Fox


Some classes, such as our hello application, have just one or more method that will be executed as a program. Only one instance of these classes is created (by the interpreter).
Other classes are used to structure data, such as the previous example. Another example might be to have a class to represent type Complex. It would have
  • variables to hold the real and imaginery parts of each instance
  • a method called Complex to initialize those variables on creation
  • methods called plus, subtract, and so on to operate on each instance of the complex class.
A computational class could create several instances of the class Complex and use them with the methods for arithmetic.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Jul 6 1999