Held: Thursday, February 12, 1998
minimum method might compute a number.
return to return a value from a
method.
public type name(parameters)
{
body
} // name
public double square(double param)
{
return param * param;
} // square
new.
public class MyProgram
{
public static void main(String[] args)
{
...
MyProgram compute = new MyProgram();
...
out.println(5 + " squared is " + compute.square(5));
} // main
} // MyProgram
See squares, revisited and temperatures in computing exercise 5 for an example and some exercises.
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 Thu May 7 10:53:52 1998.
This page generated on Thu May 7 10:58:48 1998 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu