QandA/survey.html (starting with
the course root).
.cshrc file.
source ~/.cshrc to get
those changes accepted in the same session.
.java file to a .class file,
you use javac, the Java compiler.
.class file, you use
java, the Java interpreter.
main routine, which
is the routine that the interpreter executes.
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
} // main
} // HelloWorld
HelloWorld.java.
javac HelloWorld.java
java HelloWorld
public says that our class is
publically accessible. Later, we'll see why and
how you might want to have private classes.
class tells the Java compiler that
we're defining a class.
HelloWorld names the class. In general,
the name of your class should correspond to the name
of the file that defines the class (and you should only
define one class per file).
public says that our
main function is publically accessible.
static says that the function belongs to
the class as a whole, and need not be associated with
a particular object of the class.
void says that the function has no return
value.
main names the function.
main function takes the same
set of parameters, even if it may not use them.
String[] indicates that the
parameter is an array/vector of strings.
args names that parameter.
println method of
the out object
provided by the System class, using
the string Hello World! as a
parameter.
(define (main args) (write "Hello World!"))
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:50:28 1997.
This page generated on Wed Nov 5 12:38:52 1997 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu