main method takes
an array of strings as a parameter.
% javac MyClass alpha beta gamma
main method, you refer to those arguments
as args[0] ... args[args.length] (assuming, of course,
that you've used args as the name of the one parameter to
main.
Echo, that echos the first
argument given on the command line.
Complex class, we'll have three constructors:
/**
* Initialize to 0.0 + 0.0i
*/
public Complex() {
real_part = 0.0;
imaginary_part = 0.0;
} // Complex
/**
* Initialize to x + y*i
*/
public Complex(double x,double y) {
real_part = x;
imaginary_part = y;
}
/**
* Initialize to x + 0.0i
*/
public Complex(double x) {
real_part = x;
imaginary_part = 0.0;
}
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Tue Oct 7 16:51:05 1997.
This page generated on Wed Nov 5 12:38:49 1997 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu